09.10.2016, 12:32
Hello, please read carefully.
I have a /kick command. When I'm ID 0 on the server and kick ID 1 for example it says on a message that I kicked myself but actually it kicked the target. // Or when there is a player ID 0 connected and ID 2 tries to kick ID 4 for example it says that ID 2 kicked ID 0 but it actually kicked the correct target.
I tried updating sscanf and downgrading it, but still the same.
Kick command: (This also happens with other types of commands like this)
(If someone helps me, he earns a rep from me)
I have a /kick command. When I'm ID 0 on the server and kick ID 1 for example it says on a message that I kicked myself but actually it kicked the target. // Or when there is a player ID 0 connected and ID 2 tries to kick ID 4 for example it says that ID 2 kicked ID 0 but it actually kicked the correct target.
I tried updating sscanf and downgrading it, but still the same.
Kick command: (This also happens with other types of commands like this)
PHP код:
CMD:kick(playerid, params[])
{
new
targetid,
Reason[256],
pName[MAX_PLAYER_NAME],
tName[MAX_PLAYER_NAME],
string[256]
;
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(targetid, tName, sizeof(tName));
format(string, sizeof(string), "{4286f4}(Information):{FFFFFF} Administrator {FF0000}%s{FFFFFF} has kicked {00FF00}%s{FFFFFF}! | Reason: {FFFF00}%s", pName, tName, Reason);
if(P_DATA[playerid][aLevel] < 1)return SendClientMessage(playerid, -1, "{FF0000}(ERROR):{FFFFFF} You must be Moderator to use this command!");
if(sscanf(params, "ds[256]", targetid, Reason))return SendClientMessage(playerid, -1, "{FF9900}(Usage):{FFFFFF} /kick [ID] [Reason]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "{FF0000}(ERROR):{FFFFFF} This player is not connected!");
SendClientMessageToAll(-1, string);
SetTimerEx("KickTimer", 1000, false, "i", targetid);
return 1;
}