Please help to compile this to zcmd
#1

pawn Код:
dcmd_stats(playerid, cmdtext[])
{
        new player1, tmp[256];
        new playername[MAX_PLAYER_NAME];
        new string[256], idx;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            ShowScore(playerid);
            return 1;
        }
        player1 = strval(tmp);

        if(IsPlayerConnected(player1))
        {
            GetPlayerName(player1, playername, sizeof(playername));
            format(playername,sizeof playername,"%s's status.",playername);
            format(string,sizeof(string),"Kills:\t\t%d\nDeaths:\t%d\nRatio:\t\t%0.2f\nMoney:\t$%d\n",PlayerInfo[player1][kills], PlayerInfo[player1][deaths],Float:PlayerInfo[player1][deaths]/Float:PlayerInfo[player1][deaths],GetPlayerMoney(player1));
            ShowPlayerDialog(playerid,1337,DIALOG_STYLE_MSGBOX,playername,string,"Ok","Close");
            return 1;
        }
        else
        {
        SendClientMessage(playerid, COLOR_LRED, "ERROR: Player is not connected.");
        return 1;
        }
}
Sorry i have problems with compiling this to zcmd. Please compile it for me so i can learn something from this. BTW i need this :P
Reply
#2

what's ur probleme ?
Reply
#3

pawn Код:
COMMAND:stats(playerid, params[])
{
        if(isnull(params)) return ShowScore(playerid);
        new playername[MAX_PLAYER_NAME];
        new string[128];
        new player1 = strval(params);
        if(IsPlayerConnected(player1))
        {
            GetPlayerName(player1, playername, sizeof(playername));
            format(playername,sizeof playername,"%s's status.",playername);
            format(string,sizeof(string),"Kills:\t\t%d\nDeaths:\t%d\nRatio:\t\t%0.2f\nMoney:\t$%d\n",PlayerInfo[player1][kills], PlayerInfo[player1][deaths],Float:PlayerInfo[player1][deaths]/Float:PlayerInfo[player1][deaths],GetPlayerMoney(player1));
            ShowPlayerDialog(playerid,1337,DIALOG_STYLE_MSGBOX,playername,string,"Ok","Close");
            return 1;
        }
        else
        {
        SendClientMessage(playerid, COLOR_LRED, "ERROR: Player is not connected.");
        }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)