SA-MP Forums Archive
Please help to compile this to zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help to compile this to zcmd (/showthread.php?tid=246943)



Please help to compile this to zcmd - ZamaXor - 06.04.2011

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


Re: Please help to compile this to zcmd - Matheo - 06.04.2011

what's ur probleme ?


Re: Please help to compile this to zcmd - Mokerr - 06.04.2011

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.");
        }
}