Not showing the leader names
#6

That's what you want to do, it's not done that way. I recommend reading tutorial and learning more. I'll help you just to see how it has to be done.

PHP код:
#define MAX_FACC  (4) // Number of factions
enum ENUM_FACTION_DATA
{
    
fLeader[MAX_PLAYER_NAME+1]
};
new 
Faction[MAX_FACC][ENUM_FACTION_DATA];
CMD:setleader(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        new 
targetidfacid;
        if(
sscanf(params,"ui",targetidfacid)) return SendClientMessage(playeridCOLOR_RED,"/setleader [id][Faction id]");
        if(
targetid != INVALID_PLAYER_ID)
        {
            
PlayerInfo[targetid][pFaction] = facid
            
PlayerInfo[targetid][pFacrank] = 10;
            
PlayerInfo[targetid][pFacleader] = facid;
            if(
facid == 1)
            {
                
SendClientMessage(targetid,COLOR_CYAN,"You have been made the leader of the Las Venturas PD");
                                
GetPlayerName(targetidFaction[0][fLeader], 25);
            }
            if(
facid == 2)
            {
                
SendClientMessage(targetid,COLOR_CYAN,"You have been made the leader of The Santino Family");
                            
GetPlayerName(targetidFaction[1][fLeader], 25);
            }
            if(
facid == 3)
            {
                
SendClientMessage(targetid,COLOR_CYAN,"You've been made the leader of The Manusco Crew");
                            
GetPlayerName(targetidFaction[2][fLeader], 25);
            }
            if(
facid == 4)
            {
                
SendClientMessage(targetid,COLOR_CYAN,"You've been made the leader of Back Alley Crips");
                            
GetPlayerName(targetidFaction[3][fLeader], 25);
            }
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"SERVER: Unknown command.");
    }
    return 
1;
}
CMD:factions(playerid,params[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
string[1024];
        
format(string,sizeof(string),"*Las Venturas Police Department[ID1] || Leader: %s \n*The Santino Family[ID2] || Leader: %s \n*The Manusco Crew[ID3] || Leader: %s \n*Back Alley Crips[ID4]  Leader: %s",Faction[0][fLeader],Faction[1][fLeader] , Faction[2][fLeader], Faction[3][fLeader]);
        
ShowPlayerDialog(playerid,FACTIONS,DIALOG_STYLE_MSGBOX,"Server Factions:",string,"Ok","");
    }
    return 
1;

PS: This is a sample of how you have to do it, you would also have to save it for when the server is closed, the name of the leader is saved, and I have not compiled it if it gives you errors let me know.
Reply


Messages In This Thread
Not showing the leader names - by Escobabe - 03.10.2017, 23:32
Re: Not showing the leader names - by AlexMSK - 03.10.2017, 23:39
Re: Not showing the leader names - by Escobabe - 03.10.2017, 23:49
Re: Not showing the leader names - by AlexMSK - 04.10.2017, 00:05
Re: Not showing the leader names - by Escobabe - 04.10.2017, 00:14
Re: Not showing the leader names - by Swankeh - 04.10.2017, 00:20
Re: Not showing the leader names - by AlexMSK - 04.10.2017, 00:25
Re: Not showing the leader names - by Escobabe - 04.10.2017, 12:16

Forum Jump:


Users browsing this thread: 2 Guest(s)