13.07.2014, 11:32
i get a bug when i do /warn
when i /warn 1 somereason then i press enter it warn different Player like id 2 or 3 and not the id 1 and when i warn a not connected player id it giving warn to myself any idea to those?
pawn Код:
CMD:warn(playerid, params[])
{
new str[128], id, reason[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
{
//if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid,-1, "PHT-BOT:"lgreen" /warn (playerid) (reason)")
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,lightgreen,"USAGE: "lyellow2"/warn (id) (reason)");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,error2);
format(str, sizeof(str), "» Administrator %s(%d) warns %s(%d) [Reason: %s]", GetPName(playerid), playerid, GetPName(playerid), playerid, reason);
SendClientMessageToAll(yellow, str);
format(str, sizeof(str), "» You warned %s(%d) [Reason: %s]",GetPName(playerid), playerid, reason);
SendClientMessage(playerid, green, str);
format(str, sizeof(str), "» You've been warned by Administrator%s(%d) [Reason: %s]",GetPName(playerid), playerid, reason);
SendClientMessage(id, red, str);
}
return 1;
}