Saving String
#8

PHP код:
CMD:myname(playeridparams[])
{
    if(
pInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_RED"No permission.");
    if(
isnull(params)) return SendClientMessage(playerid, -1"Usage: /myname [your name]");
    if(
strlen(params) >= MAX_PLAYER_NAME) return SendClientMessage(playeridCOLOR_RED"Too long name.");
    
    
strcpy(pInfo[playerid][pAdminName], paramsMAX_PLAYER_NAME);
    
// change the size of "pAdminName" in the enum to MAX_PLAYER_NAME
    
return 1;
}
CMD:admins(playeridparams[])
{
    new 
string[90];
    
SendClientMessage(playeridCOLOR_GREY"Admins online:");
    
    foreach(new 
Player// your syntax was old and deprecated + it loops though connected players ONLY
    
{
        if(
pInfo[i][pAdmin] >= 1)
        {
            
format(stringsizeof(string), "(ID: %d) %s %s (Admin level: %d)"iPlayerName(i), pInfo[i][pAdminName], pInfo[i][pAdmin]);
            
SendClientMessage(playeridpInfo[i][pDuty] ? COLOR_ORANGE COLOR_GREYstring);
        }
    }
    return 
1;

Reply


Messages In This Thread
Saving String - by 025Tadija - 24.06.2015, 14:47
Re : Saving String - by Dutheil - 24.06.2015, 14:54
Re : Saving String - by KillerDVX - 24.06.2015, 14:58
Re: Saving String - by Darkwood17 - 24.06.2015, 15:02
Re: Saving String - by 025Tadija - 24.06.2015, 15:13
Re : Saving String - by KillerDVX - 24.06.2015, 15:14
Re: Saving String - by 025Tadija - 24.06.2015, 15:19
Re: Saving String - by Konstantinos - 24.06.2015, 15:26
Re : Saving String - by KillerDVX - 24.06.2015, 15:32
Re: Saving String - by 025Tadija - 24.06.2015, 15:32

Forum Jump:


Users browsing this thread: 1 Guest(s)