sscanf error[+rep]
#1

Hello There,

pawn Код:
COMMAND:warn(playerid, params[])
{
if(PlayerInfo[playerid][PlayerAdmin] <= 1) return SendClientMessage(playerid,COLOR_RED,"You Cant Use This Command !!!");
new targetid,String[128];
if (sscanf(params,"us", targetid, String)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: "SININE"/warn "SININE"[ID] [reason]");
if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
new Name[MAX_PLAYER_NAME];GetPlayerName(playerid,Name,sizeof(Name));
new string[156];format(string, sizeof string, ""RED"You have been "RED"warned "RED"by "RED"%s "RED"for "RED"%s",Name,String);
SendClientMessage(targetid,COLOR_RED,string);
new OtherName[MAX_PLAYER_NAME];
GetPlayerName(targetid,OtherName,sizeof(OtherName));
format(string, sizeof string, "%s has been warned by %s for %s",OtherName,Name,string);
SendClientMessageToAll(COLOR_RED,string);
return 1;
}
and i get this sscanf error

Код:
sscanf warning: Strings without a length are deprecated, please add a destination size
Help....Tried what other topics said.
Reply
#2

Simply change your sscanf line to this:
pawn Код:
if (sscanf(params,"us[128]", targetid, String))
Reply
#3

Found it.Thanks anyways +repped
Reply
#4

lol that was quick!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)