I am trying to make my functions such as /flamer work as /flamer //self and /flamer <id> but I cannot get GetPeice to work rite, if I use this:
function OnCommand(ID: byte; text: string): boolean;
begin
If GetPiece(text,' ',2) <> Nil Then target := StrToInt(GetPiece(text,' ',2)) Else Target := ID
if GetPiece(text,' ',1) = '/flamer' then begin
ForceWeapon(target,11,GetPlayerstat(ID,'secondary'),0);
end;
end;
but it will not work. What am I doing wrong?
EDIT: It only works 1 out of 20 times if you specify an id.. wtf