problem with sscanf optionaler parameter
#5

pawn Код:
ocmd:stats(playerid,params[])
{
    new pID;
    if(!sscanf(params,"r",pID))
    {
        if (!IsPlayerConnected(pID)) return SCM(playerid,grau,"Invalid player.");
        new str[64];
        format(str,sizeof(str),"Level: %d            Money: %d\n",Player[pID][Level],Player[pID][Money]);
        ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"caption",str,"OK","");
    }
    else
    {
        if (!strlen(params))
        {
            new str[64];
            format(str,sizeof(str),"Level: %d            Money: %d\n",Player[playerid][Level],Player[playerid][Money]);
            ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"caption",str,"OK","");
        }
        else SCM(playerid,grau,"Admin: /stats [playerid/name].")
    }
    return 1;
}
Reply


Messages In This Thread
problem with sscanf optionaler parameter - by WhiteKinG - 14.02.2014, 20:32
Re: problem with sscanf optionaler parameter - by Blademaster680 - 14.02.2014, 20:38
AW: problem with sscanf optionaler parameter - by WhiteKinG - 14.02.2014, 20:45
Re: problem with sscanf optionaler parameter - by CuervO - 14.02.2014, 20:45
Re: problem with sscanf optionaler parameter - by Konstantinos - 14.02.2014, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)