20.02.2013, 17:31
Hello, as I've started scripting again I have had a few problems but I need to know what's causing and how I fix this. When I use the command /kick a message pops up in the server log saying: "sscanf warning: Strings without a length are deprecated, please add a destination size."
This is the code:
This is the code:
Код:
CMD:kick(playerid, params[]) { new id, reason[128], string[128], playername[MAX_PLAYER_NAME], playid[MAX_PLAYER_NAME]; if(sscanf(params, "us", id, reason)){SendClientMessage(playerid, COLOR_RED, "Correct usage: /kick [playerid] [Reason]");} else if(!IsPlayerConnected(id)){SendClientMessage(playerid, COLOR_RED, "The selected player is not connected.");} else if(PlayerInfo[id][pAdmin] > 0) {SendClientMessage(playerid, COLOR_RED, "The selected player is an admin.");} else{ GetPlayerName(id, playid, sizeof(playid)); GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string),"[SERVER] %s has been kicked by %s. [Reason]: %s", playid, playername, reason[127]); SendClientMessageToAll(COLOR_WHITE, string); Kick(id); } return 1; }