/stats for this Script
#5

Quote:
Originally Posted by Wasim_Cortez
Put this under the "Forward"'s you have in your script.
pawn Код:
forward ShowStats(playerid,targetid);
Put this under "Onplayercommandtext"
pawn Код:
//______________________________________________________________________________
//                /Stats
    if (strcmp(cmd, "/stats", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (gPlayerLogged[playerid] != 0)
    {
    ShowStats(playerid,playerid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "[STATS] You need to Login to use this Command.");
    }
    }
    return 1;
    }
Then put this anywhere in your gamemode, I have it near the bottem.
pawn Код:
public ShowStats(playerid,targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Cash = GetPlayerMoney(targetid);
        new Deaths = PlayerInfo[targetid][pDeaths];
        new Kills = PlayerInfo[targetid][pKills];
        new pName[MAX_PLAYER_NAME];
        new ptime = PlayerInfo[targetid][pConnectTime];
        GetPlayerName(targetid, pName, sizeof(pName));
        new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(targetid, pX,pY,pZ);
        new CoordString[256];
        SendClientMessage(playerid, COLOR_GREEN,"________________________________________________________________");
        // In here add the stats you want to show!!
        SendClientMessage(playerid, COLOR_GREEN,"________________________________________________________________");
    }
}
There you go, Just remember to add the stats you want where it says it in the script...
How do i add then..
// In here add the stats you want to show!! <--- Don't now how to add..
Just SendClientMessage(playerid, COLOR_WHITE, cash);?
Reply


Messages In This Thread
/stats for this Script - by Ihsan_Cingisiz - 30.05.2010, 11:18
Re: /stats for this Script - by johnnyc - 30.05.2010, 11:23
Re: /stats for this Script - by Ihsan_Cingisiz - 30.05.2010, 11:26
Re: /stats for this Script - by Wasim_Cortez - 30.05.2010, 12:09
Re: /stats for this Script - by Ihsan_Cingisiz - 30.05.2010, 12:21
Re: /stats for this Script - by Conroy - 30.05.2010, 12:52
Re: /stats for this Script - by Ihsan_Cingisiz - 30.05.2010, 15:02
Re: /stats for this Script - by Conroy - 30.05.2010, 15:03
Re: /stats for this Script - by Ihsan_Cingisiz - 30.05.2010, 15:08
Re: /stats for this Script - by Conroy - 30.05.2010, 15:11

Forum Jump:


Users browsing this thread: 2 Guest(s)