Sscanf help (/STATS COMMAND)
#2

pawn Код:
CMD:stats(playerid, params[])
{
    new target, sString1[90], sString2[90], sString3[90];
    if(sscanf(params, "u", target))
    {
        format(sString1, sizeof(sString1), "______ [%d]%s's statstics ________ ", playerid, PlayerName(playerid) );
        format(sString2, sizeof(sString2), "Name: %s  Kills: %d  Deaths: %d  Money: %d Rank: %d ", PlayerName(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Money], PlayerInfo[playerid][Rank]);
        format(sString2, sizeof(sString3), "Donor rank: %d  Achievements: %d  Admin level: %d ", PlayerInfo[playerid][DRank], PlayerInfo[playerid][Achievements], PlayerInfo[playerid][AdminLevel]);
        SendClientMessage(playerid, GREEN, sString1);
        SendClientMessage(playerid, GREEN, sString2);
        SendClientMessage(playerid, GREEN, sString3);
    }
   
    else
    {
        format(sString1, sizeof(sString1), "______ [%d]%s's statstics ________ ", target, PlayerName(target));
        format(sString2, sizeof(sString2), "Name: %s  Kills: %d  Deaths: %d  Money: %d Rank: %d ", PlayerName(target), PlayerInfo[target][Kills], PlayerInfo[target][Deaths], PlayerInfo[target][Money], PlayerInfo[target][Rank]);
        format(sString2, sizeof(sString3), "Donor rank: %d  Achievements: %d  Admin level: %d ", PlayerInfo[target][DRank], PlayerInfo[target][Achievements], PlayerInfo[target][AdminLevel]);
        SendClientMessage(playerid, GREEN, sString1);
        SendClientMessage(playerid, GREEN, sString2);
        SendClientMessage(playerid, GREEN, sString3);
    }
    return 1;
}
You have forgotten some commas..
Reply


Messages In This Thread
Sscanf help (/STATS COMMAND) - by Gangs_Rocks - 12.07.2012, 10:31
Re: Sscanf help (/STATS COMMAND) - by aRoach - 12.07.2012, 11:45

Forum Jump:


Users browsing this thread: 2 Guest(s)