sscanf warning
#2

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Hello,

In my console I'm getting this message when I'm doing some commands:
Код:
 sscanf warning: Format specifier does not match parameter count
Example of one of the codes:
pawn Код:
//-----[Slap]-----
CMD:slap(playerid, params[])
{
    if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You aren't admin.");
    new targetid;
    if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: [PlayerID]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Player not connected");
    else
    {
    new Float:SLX, Float:SLY, Float:SLZ;
    GetPlayerPos(targetid, SLX, SLY, SLZ);
    SetPlayerPos(targetid, SLX, SLY, SLZ+5);
    PlayerPlaySound(targetid, 1130, SLX, SLY, SLZ+5);
    new string[128];
    new pName[24], pTame[24];
    GetPlayerName(playerid,pName,24);
    GetPlayerName(targetid,pTame,24);
    format(string,sizeof string,""#COL_ORANGE"%s has been slapped by Administrator %s.",pTame,pName);
    SendClientMessageToAll(COLOR_RED, string);
    }
    return 1;
}
PHP код:
CMD:slap(playeridparams[])
{
    if(
PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You aren't admin.");
    new 
targetid;
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /slap [PlayerID]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_WHITE"Player not connected");
    new 
Float:SLXFloat:SLYFloat:SLZ;
    
GetPlayerPos(targetidSLXSLYSLZ);
    
SetPlayerPos(targetidSLXSLYSLZ+5);
    
PlayerPlaySound(targetid1130SLXSLYSLZ+5);
    new 
string[128];
    new 
pName[24], pTame[24];
    
GetPlayerName(playerid,pName,24);
    
GetPlayerName(targetid,pTame,24);
    
format(string,sizeof string,""#COL_ORANGE"%s has been slapped by Administrator %s.",pTame,pName);
    
SendClientMessageToAll(COLOR_REDstring);
    return 
1;

Reply


Messages In This Thread
sscanf warning - by Kingunit - 27.08.2011, 19:57
Re: sscanf warning - by Kush - 27.08.2011, 20:00
Re: sscanf warning - by Kingunit - 27.08.2011, 20:02
Re: sscanf warning - by Kingunit - 27.08.2011, 20:07

Forum Jump:


Users browsing this thread: 2 Guest(s)