sscanf strings problem
#1

Код:
CMD:prison(playerid,params[])
{
	new Random = random(sizeof(AreaSpawns));
 	new id,time,reason[100],GPlayerName[MAX_PLAYER_NAME], string[128];
  	if(PlayerInfo[playerid][pAdmin] < 2) return 1;
   	else if(sscanf(params,"uds",id,time,reason)) return SendClientMessage(playerid, COLOR_RED, "/prison <playerid> <time> <reason>");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Igrac nije na serveru");
    else if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin])return SendClientMessage(playerid,COLOR_RED,""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Nemozes zatvoriti veci Admin Level");
    else if(Jailed[id] == 1)return SendClientMessage(playerid,COLOR_RED,"Igrac je vec u zatvoru");
    {
        GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
        format(string, sizeof(string), "Zatvoren si na %d minuta; Razlog: %s", time, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "Admin %s je zatvorio igraca %s (ID:%d) na %s minuta; Razlog: %s", GPlayerName, PlayerName(id), id, time, reason);
        SendAdminMessage(1, COLOR_CHARTREUSE, string);
        Jailed[id] = 1;
        SetPlayerInterior(id, 0);
        SetPlayerVirtualWorld(id, 0);
        SetPlayerFacingAngle(id, 360.0);
    	SetPlayerPos(id, AreaSpawns[Random][0], AreaSpawns[Random][1], AreaSpawns[Random][2]);
        ResetPlayerWeapons(id);
        JailTimer[id] = SetTimer("Unjail",time*60000, false);
	}
    return 1;
}
why this problem: sscanf warning: Strings without a length are deprecated, please add a destination size.
Reply


Messages In This Thread
sscanf strings problem - by FL3GM4 - 05.01.2013, 19:04
Re: sscanf strings problem - by Infinity90 - 05.01.2013, 19:10
Re: sscanf strings problem - by Vince - 05.01.2013, 19:25

Forum Jump:


Users browsing this thread: 4 Guest(s)