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
#2

Deleted
Reply
#3

Quote:
Originally Posted by Infinity90
Посмотреть сообщение
pawn Код:
//code
And what exactly was the purpose of raising the size of the 'reason' array? The maximum chat input is 128.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)