0 Members and 1 Guest are viewing this topic.
function OnPlayerCommand(ID: Byte; Text: string): boolean;var allplayersdie : byte; dmgamount : integer; temps : string;begin if pos('/dmg ',temps) = 1 then begin temps := Text; temps := delete(temps,1,5); dmgamount := strtoint(temps); for allplayersdie := 1 to NumPlayers do DoDamage(allplayersdie, dmgamount) endend;
09-09-07 21:09:13 DeathDmg -> [Error] (10:9): Identifier expected
function OnPlayerCommand(ID: Byte; Text: string): boolean;var allplayersdie : byte; dmgamount : integer; temps : string;begin if pos('/dmg ', temps) = 1 then begin temps := Text; Delete(temps, 1, 5); dmgamount := strtoint(temps); for allplayersdie := 1 to NumPlayers do DoDamage(allplayersdie, dmgamount) endend;
if GetPiece(text,' ',0) = '/dmg' then try DoDamage(IntToStr(GetPiece(text,' ',1)), IntToStr(GetPiece(text,' ',2)));except WriteConsole(ID,'/dmg <id> <dmg>',$AA0000);end;