/check command not detecting Target's statistics correctly.
#5

pawn Код:
CMD:check(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >=2)
    {
        new target;
        if(sscanf(params, "u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /check [playerid]");
        if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player ID is not connected.");
        new string[200];
        format(string,sizeof(string), "%s's current statistics: Money: %d || VIP: %d || Kills: %d || Deaths: %d || Score: %d || Admin: %s || Talent: %s",GetName(target),
        PlayerInfo[target][pCash],
        PlayerInfo[target][pVip],
        PlayerInfo[target][pKills],
        PlayerInfo[target][pDeaths],
        PlayerInfo[target][pScore],
        GetAdminLvlName(target),
        GetTalentName(target));
        SendClientMessage(playerid,COLOR_GREEN, string);
    }
    else return SendClientMessage(playerid,COLOR_GREY, ERROR);
    return 1;
}
This command seems good, you just have to check if your vars are okay as well.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)