Help with command
#1

Can someone make me this command with strcmp

PHP код:
CMD:admins(playeridparams[])
{
    new 
string[256];
    new 
fstring[64];
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
level[i] > 0)
        {
            new 
pname[MAX_PLAYER_NAME];
            
GetPlayerName(i,pnamesizeof(pname));
            
format(fstringsizeof(fstring),"%s (%i) - {FF0000}Level: %i{FFFFFF}\n"pnameilevel[i]);
            
strcat(stringfstringsizeof(string));
        }
    }
    
ShowPlayerDialog(playerid,2563,DIALOG_STYLE_LIST,"Online Admins",string,"OK","");
    return 
1;

Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)