Need help on a /factions command
#1

Greetings! I need help on creating a /factions command, in which it shows up the faction name, the leader's name and the owner's name. Thanks for the help!
Reply
#2

« Would help if you handed out some code to aid in making this command, but you know, Scripting Help isn't really for making you a command...
But if someone was going to be kind, then they'd need some basis to go on, rather than nothing and guess everything. » - Sew_Suni

Anyway, you can do a loop with which is checking every players's faction with the faction desired.
Like this command, which is similar:
PHP код:
CMD:admins(playerid,params[])
{
    
SendClientMessage(playeridvert"|---------------------- "adminUA"Online Admins"vertU" ----------------------|");
    new 
a;
    foreach(new 
Player// same as for(new i=0; i<MAX_PLAYERS; i++)
    
{
        if(
PlayerInfo[i][pAdminlvl] == 5)
        {
            
a+1;
             new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), "[Fondateur] » "blancU"%s"name);
            
SendClientMessage(playeridred1str);
        }
        else if(
PlayerInfo[i][pAdminlvl] == 4)
        {
            
a+1;
             new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), mappeur"[Mappeur] » "blancU"%s"name);
            
SendClientMessage(playeridX11_STEEL_BLUE_2str);
        }
         else if(
PlayerInfo[i][pAdminlvl] == 3)
        {
            new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), "[Admin] » "blancU"%s"name);
            
SendClientMessage(playeridredstr);
            
a+1;
        }
         else if(
PlayerInfo[i][pAdminlvl] > 0)
        {
            new 
name[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME+120];
            
GetPlayerName(inamesizeof(name));
            
format(strsizeof(str), modooPs"[Modo] » "blancU"%s"name);
            
SendClientMessage(playerid, -1str);
            
a+1;
        }
    }
    new 
str9[120];
    
format(str9sizeof(str9), "There are %i admins connected!"a);
    
SendClientMessage(playeridX11_LIGHT_YELLOW_3str9);
    
SendClientMessage(playeridvert"|---------------------------------------------------------------|");
    return 
1;

Reply
#3

Thanks! Really appreciated! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)