Problem with sscanf
#1

This is just one of my codes:
PHP код:
CMD:setskin(playeridparams[])
{
    if(!
PlayerInfo[playerid][pAdmin])
        return 
0;
    new
        
id,
        
skin,
        
string[72]
     ;
     
printf("b");
     if(
sscanf(params,"ui",id,skin))
        return 
SendClientMessage(playerid,C_NICE,"[Usage] {FFFFFF}/setskin [playerid/PON] [skin]");
    
printf("%i | %i",id,skin);
    if(!
IsPlayerConnected(id))
      {
          
printf("c");
          return 
0;
       }
       
printf("a");
    
SetPlayerSkin(idskin);
    
PlayerInfo[id][pSkin] = skin;
    
printf("d");
    
SendFormat(id,C_GRAD2,"%s has set your skin to %i",GetName(playerid),skin);
    
SendFormat(playerid,C_GRAD2,"You have set %s skin to %i",GetName(id),skin);
    
format(string,sizeof(string),"AdmWrn: {DABB3E}%s has set %s's skin to %i",GetName(playerid),GetName(id),skin);
    
AMsg(string,C_RED);
    
printf("e");
    return 
1;

All the letters are for debugging.
Since I moved my server to 0.3d the "u" function that detects both names and numbers of users stopped working ALL over my mode. Does anyone know how to fix it?
Reply
#2

Sscanf don't work on 0.3d version.
Reply
#3

The 'u' is bugged in 0.3d. Use the normal int instead:
pawn Код:
if(sscanf(params,"ii",id,skin))
Reply
#4

Doesn't "u" check if they are online and if not return INVALID_PLAYER_ID though?

This means you now have to check exclusively?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)