SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/05/2016, 12:43 AM   #1
NealPeteros
Gangsta
 
NealPeteros's Avatar
 
Join Date: Dec 2015
Location: GetPlayerCountry(playerid);
Posts: 654
Reputation: 51
Default Need help on a /factions command

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!
NealPeteros is offline   Reply With Quote
Old 25/05/2016, 05:36 AM   #2
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 258
Default Re: Need help on a /factions command

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 Code:
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;

__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 25/05/2016, 08:17 AM   #3
NealPeteros
Gangsta
 
NealPeteros's Avatar
 
Join Date: Dec 2015
Location: GetPlayerCountry(playerid);
Posts: 654
Reputation: 51
Default Re: Need help on a /factions command

Thanks! Really appreciated! +rep
NealPeteros is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/factions command vrrp Scripting Help 5 13/02/2016 10:11 AM
Factions TheSnaKe Everything and Nothing 9 22/12/2014 11:33 AM
Static factions or Dynamic Factions? seanny Scripting Help 2 20/09/2011 10:17 PM
Factions Anthonyx3' Help Archive 5 08/10/2010 08:47 AM
help with the command / Factions marc_sanchez Client Support 0 17/04/2010 08:51 AM


All times are GMT. The time now is 05:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.