18.12.2012, 20:03
hello guys. i am just wondering. does this harm the server or anything? because when i type some of my commands the sscanf warning shows on console
can anyone tell? why sscanf gives thar warning?
Command
Код:
[21:20:09] sscanf warning: 'z' is deprecated, consider using 'S' instead. [21:20:09] sscanf warning: No default value found. [21:20:09] sscanf warning: Format specifier does not match parameter count. [21:20:14] sscanf warning: 'z' is deprecated, consider using 'S' instead. [21:20:14] sscanf warning: No default value found. [21:20:14] sscanf warning: Format specifier does not match parameter count.
Command
pawn Код:
dcmd_adjail(playerid,params[])
{
new string[128], ID, cmdtime, reason[128];
if(sscanf(params, "udz", ID, cmdtime, reason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adjail (Player Name/ID) (Seconds) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string,sizeof(string),"Administrator %s(%d) Has Jailed %s(%d) Reason: %s. ",PlayerName(playerid),playerid,PlayerName(ID),ID, reason);
SendClientMessageToAll(COLOR_ADMIN,string);
format(string,sizeof(string),"[ADMIN] You have been Admin Jailed for %d seconds, by Admin %s, Reason: %s.",cmdtime,PlayerName(playerid), reason);
SendClientMessage(ID,COLOR_ERROR,string);
format(string,sizeof(string),"Administrator %s(%d) Has Jailed %s(%d) Reason: %s. ",PlayerName(playerid),playerid,PlayerName(ID),ID, reason);
//TextDraw
TextDrawShowForPlayer(ID,JailTimer[ID]);
//Others
ResetPlayerWeapons(ID);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] = cmdtime;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] = cmdtime;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
SetPlayerVirtualWorld(ID, 0);
return 1;
}