27.07.2011, 06:12
So i get these warning's
So heres the code that its happening at.
Код:
[02:08:57] sscanf warning: 'z' is deprecated, consider using 'S' instead. [02:08:57] sscanf warning: No default value found. [02:08:57] sscanf warning: Format specifier does not match parameter count.
PHP код:
CMD:freeze(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_RED,"Usage:/freeze [ID] [reason]");
else if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"System: Invalid ID");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
else
{
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
format(string,sizeof(string),"You have been freezed by Admin: %s for %s",n,reason);
SendClientMessage(playerid,COLOR_RED,string);//
format(string2, sizeof(string), "Admin Action: %s has freezed %s because: %s",n,on,reason);
SendClientMessageToAll(COLOR_RED,string2);
TogglePlayerControllable(playerid,0);
}
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
return 1;
}
CMD:unfreeze(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_RED,"Usage:/unfreeze [ID] [reason]");
else if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"System: Invalid ID");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
else
{
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
format(string,sizeof(string),"You have been unfreezed by Admin: %s for %s",n,reason);
SendClientMessage(playerid,COLOR_RED,string);//
format(string2, sizeof(string), "Admin Action: %s has unfreezed %s because: %s",n,on,reason);
SendClientMessageToAll(COLOR_RED,string2);
TogglePlayerControllable(playerid,1);
}
}
else return SendClientMessage(playerid,COLOR_RED," You are not allowed to use this command!");
return 1;
}