[Tutorial] Faction system [Y_INI]
#13

Quote:
Originally Posted by mrikill
View Post
my commands..

PHP Code:
CMD:invite(playeridparams[])
{
    if(
PlayerInfo[playerid][pFacleader] > || PlayerInfo[playerid][pFacrank] >= 5)
    {
        new 
taridfacid;//establishes a player in the server and a faction id for you to type in
        
if(sscanf(params"u"tarid)) return SendClientMessage(playeridCOLOR_RED"{0033cc}FACTION:Използвайте: /invite [playerid]");//if the command is not typed correctly, it will show you the correct way to use the command.
        
facid PlayerInfo[playerid][pFaction];//sets the faction the player is being invited to, as the faction the player that is inviting is in.
        
SetPVarInt(tarid"invitefac"facid);//saves the invite, to /accept it
        
SendClientMessage(taridCOLOR_GREEN"{0033cc}FACTION:Вие получихте покана за банда/мафия , използвайте /acceptinvite за да я приемете!");//tells you that you have been invited to a faction
    
}
    else 
//if you're not the correct rank it will display the message below stating that the player is not the rank to invite
    
{
        
SendClientMessage(playeridCOLOR_RED"{0033cc}FACTION:Вие трябва да сте 5 ранг за да може да инвийтвате");
    }
    return 
1;
}
CMD:acceptfaction(playeridparams[])
{
    new 
facidstring[128];//creates a faction id and some text on the players screen
    
facid GetPVarInt(playerid"invitefac");//calls the saved invite from the previous command
    
PlayerInfo[playerid][pFaction] = facid//sets the players faction to that of the person inviting.
    
PlayerInfo[playerid][pFacrank] = 1;//sets the players faction rank to 1
    
format(stringsizeof(string), "FACTION:Вие приехте предложението за влизане в банда %d"facid);//tells the player they have accepted the faction invite
    
SendClientMessage(playeridCOLOR_CYANstring);//shows the above message in the color of CYAN
    
DeletePVar(playerid"invitefac");//deletes the saved invite
    
return 1;

This looks like it should work to me.. does it compile alright?
Reply


Messages In This Thread
Faction system [Y_INI] - by nogh445 - 29.11.2014, 08:57
Re: Faction system [Y_INI] - by Sparke - 30.11.2014, 09:31
Re: Faction system [Y_INI] - by nogh445 - 30.11.2014, 14:38
Re: Faction system [Y_INI] - by Lukasz56 - 01.01.2015, 15:17
Re: Faction system [Y_INI] - by UploaD - 01.01.2015, 20:35
Re: Faction system [Y_INI] - by nogh445 - 01.01.2015, 20:50
Re: Faction system [Y_INI] - by nogh445 - 01.01.2015, 21:22
Re: Faction system [Y_INI] - by TheRaGeLord - 06.01.2015, 05:10
Re: Faction system [Y_INI] - by Wipe - 06.01.2015, 12:17
Re: Faction system [Y_INI] - by mrikill - 18.01.2015, 14:53
Re: Faction system [Y_INI] - by nogh445 - 19.01.2015, 01:18
Re: Faction system [Y_INI] - by mrikill - 26.01.2015, 08:55
Re: Faction system [Y_INI] - by nogh445 - 27.01.2015, 03:38
Re: Faction system [Y_INI] - by Kyance - 27.01.2015, 08:46
Re: Faction system [Y_INI] - by TheRaGeLord - 28.01.2015, 11:43
Re: Faction system [Y_INI] - by nogh445 - 28.01.2015, 16:34
Re: Faction system [Y_INI] - by K0UMA - 28.01.2015, 17:00
Respuesta: Faction system [Y_INI] - by maverick91 - 20.05.2016, 19:13
Re: Faction system [Y_INI] - by SystemX - 25.05.2016, 09:53
Re: Faction system [Y_INI] - by AliBro - 26.05.2016, 09:56
Re: Faction system [Y_INI] - by nogh445 - 26.07.2016, 00:05
Re: Faction system [Y_INI] - by ActionTanki91 - 03.08.2016, 10:03
Re: Faction system [Y_INI] - by ActionTanki91 - 03.08.2016, 19:30
Re: Faction system [Y_INI] - by MrCesar - 17.10.2016, 14:11
Re: Faction system [Y_INI] - by Lucases - 29.08.2017, 19:51
Re: Faction system [Y_INI] - by Hansrutger - 29.08.2017, 20:36
Re: Faction system [Y_INI] - by Kane - 29.08.2017, 22:16
Re: Faction system [Y_INI] - by Xeon™ - 29.08.2017, 23:19
Re: Faction system [Y_INI] - by PlayHard - 12.01.2018, 03:36
Re: Faction system [Y_INI] - by Abreezy - 11.07.2018, 00:43
Re: Faction system [Y_INI] - by JasonRiggs - 11.07.2018, 00:50

Forum Jump:


Users browsing this thread: 2 Guest(s)