A small reqest - 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)
+--- Thread: A small reqest (
/showthread.php?tid=513236)
A small reqest -
weedxd - 15.05.2014
I wanted to ask if somone could make a simple /stats cmd for me with these sections shown:
Score,
Cash,
Kills,
TerroristLVL,
RapeistLVL,
SwatMemmber(Yes/No),
ArmyMemmber(Yes/No),
RegularPlayer(Yes/No),
AdminLVL,
Playtime(Hours).
Rep from me to one who does it
Re: A small reqest -
Hwang - 15.05.2014
Resources, it can replicate them;
pawn Код:
CMD:stats(playerid)
{
new statz[1024];
strcat(statz, "Score: %d\n",GetPlayerScore(playerid));
strcat(statz, "Money: $%d\n",GetPlayerMoney(playerid));
ShowPlayerDialog(playerid,644,DIALOG_STYLE_MSGBOX,"Stats",statz,"Close","");
return true;
}
Re: A small reqest -
weedxd - 15.05.2014
Quote:
Originally Posted by Hwang
Resources, it can replicate them;
pawn Код:
CMD:stats(playerid) { new statz[1024]; strcat(statz, "Score: %d\n",GetPlayerScore(playerid)); strcat(statz, "Money: $%d\n",GetPlayerMoney(playerid)); ShowPlayerDialog(playerid,644,DIALOG_STYLE_MSGBOX,"Stats",statz,"Close",""); return true; }
|
U mean that i can use the given tepmplate which u made like this? and just add them under the code of money ?
PHP код:
strcat(statz, "Kills: %d\n",GetPlayerKills(playerid));
Re: A small reqest -
Hwang - 15.05.2014
Quote:
Originally Posted by weedxd
U mean that i can use the given tepmplate which u made like this? and just add them under the code of money ?
PHP код:
strcat(statz, "Kills: %d\n",GetPlayerKills(playerid));
|
It would not be out of the way, he getplayerkills not a function, but you can do as follows:
OnPlayerDeath:
Strcat:
pawn Код:
strcat(statz, "Kills: %d\n",KILLZ[playerid]);
Re: A small reqest -
weedxd - 15.05.2014
Quote:
Originally Posted by Hwang
It would not be out of the way, he getplayerkills not a function, but you can do as follows:
OnPlayerDeath:
Strcat:
pawn Код:
strcat(statz, "Kills: %d\n",KILLZ[playerid]);
|
Btw gamemode is dcmd i think it would have probs with this
Re: A small reqest -
Hwang - 15.05.2014
Quote:
Originally Posted by weedxd
Btw gamemode is dcmd i think it would have probs with this
|
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
OnPlayerCommandText:
pawn Код:
dcmd_stats(playerid, params[])
{
#pragma unused params
//Codes Here
return true;
}
Re: A small reqest -
Hwang - 15.05.2014
pawn Код:
dcmd_stats(playerid, params[])
{
#pragma unused params
new statz[1024];
strcat(statz, "Score: %d\n",GetPlayerScore(playerid));
strcat(statz, "Money: $%d\n",GetPlayerMoney(playerid));
strcat(statz, "Kills: %d\n",KILLZ[playerid]);
ShowPlayerDialog(playerid,644,DIALOG_STYLE_MSGBOX,"Stats",statz,"Close","");
return true;
}
Re: A small reqest -
weedxd - 15.05.2014
Quote:
Originally Posted by Hwang
pawn Код:
dcmd_stats(playerid, params[]) { #pragma unused params new statz[1024]; strcat(statz, "Score: %d\n",GetPlayerScore(playerid)); strcat(statz, "Money: $%d\n",GetPlayerMoney(playerid)); strcat(statz, "Kills: %d\n",KILLZ[playerid]); ShowPlayerDialog(playerid,644,DIALOG_STYLE_MSGBOX,"Stats",statz,"Close",""); return true; }
|
Score
Cash
Kills
TerroristLVL
RapeistLVL
SwatMemmber(Yes/No)
ArmyMemmber(Yes/No)
RegularPlayer(Yes/No)
AdminLVL
Playtime(Hours)
With these