Help with command - 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: Help with command (
/showthread.php?tid=319316)
Help with command -
boyan96 - 18.02.2012
Can someone make me this command with strcmp
PHP код:
CMD:admins(playerid, params[])
{
new string[256];
new fstring[64];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(level[i] > 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i,pname, sizeof(pname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", pname, i, level[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,2563,DIALOG_STYLE_LIST,"Online Admins",string,"OK","");
return 1;
}
Re: Help with command -
[MG]Dimi - 19.02.2012
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp("/admins",cmdtext,true))
{
new string[256];
new fstring[64];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(level[i] > 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i,pname, sizeof(pname));
format(fstring, sizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n", pname, i, level[i]);
strcat(string, fstring, sizeof(string));
}
}
ShowPlayerDialog(playerid,2563,DIALOG_STYLE_LIST,"Online Admins",string,"OK","");
return 1;
}
return 0;
}
Here.