SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 19/01/2015, 01:18 AM   #11
nogh445
Big Clucker
 
nogh445's Avatar
 
Join Date: Sep 2011
Posts: 130
Reputation: 10
Default Re: Faction system [Y_INI]

Have you changed the command at all? that command that is there should be working. if you've changed it post your new /acceptinvite command here and i will look at it
nogh445 is offline   Reply With Quote
Old 26/01/2015, 08:55 AM   #12
mrikill
Little Clucker
 
Join Date: Jul 2014
Posts: 8
Reputation: 0
Default Re: Faction system [Y_INI]

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;

__________________
if(HelpedMe[playerid] == 1)
{
Rep++;
}
mrikill is offline   Reply With Quote
Old 27/01/2015, 03:38 AM   #13
nogh445
Big Clucker
 
nogh445's Avatar
 
Join Date: Sep 2011
Posts: 130
Reputation: 10
Default Re: Faction system [Y_INI]

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?
nogh445 is offline   Reply With Quote
Old 27/01/2015, 08:46 AM   #14
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 818
Reputation: 92
Default Re: Faction system [Y_INI]

Its amazing how you made it so... simple!
Pretty sure you can do this in MySQL - but ofc. with some extras ( faction name for an example )
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance is offline   Reply With Quote
Old 28/01/2015, 11:43 AM   #15
TheRaGeLord
Banned
 
Join Date: Jun 2014
Posts: 317
Reputation: 24
Default Re: Faction system [Y_INI]

Really Nice
TheRaGeLord is offline   Reply With Quote
Old 28/01/2015, 04:34 PM   #16
nogh445
Big Clucker
 
nogh445's Avatar
 
Join Date: Sep 2011
Posts: 130
Reputation: 10
Default Re: Faction system [Y_INI]

Quote:
Originally Posted by Kyance View Post
Its amazing how you made it so... simple!
Pretty sure you can do this in MySQL - but ofc. with some extras ( faction name for an example )
Simplicity is what I like!


Quote:
Originally Posted by TheRaGeLord View Post
Really Nice
Thank you sir!
nogh445 is offline   Reply With Quote
Old 28/01/2015, 05:00 PM   #17
K0UMA
Little Clucker
 
Join Date: Jan 2015
Posts: 6
Reputation: 0
Default Re: Faction system [Y_INI]

Simple and good
K0UMA is offline   Reply With Quote
Old 20/05/2016, 07:13 PM   #18
maverick91
Little Clucker
 
Join Date: Sep 2014
Posts: 7
Reputation: 0
Default Respuesta: Faction system [Y_INI]

Can /createfaction
maverick91 is offline   Reply With Quote
Old 25/05/2016, 09:53 AM   #19
SystemX
Big Clucker
 
SystemX's Avatar
 
Join Date: Nov 2015
Location: !ncredible !ndia
Posts: 72
Reputation: 17
Default Re: Faction system [Y_INI]

Quote:
CMD:acceptinvite(playerid, params[])
{

new facid, string[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(string, sizeof(string), "> You have accepted the invite to faction %d", facid);//tells the player they have accepted the faction invite
SendClientMessage(playerid, COLOR_CYAN, string);//shows the above message in the color of CYAN
DeletePVar(playerid, "invitefac");//deletes the saved invite
return 1;
}
What if the player does not have a faction invite? Add a check, example:

Quote:

//Under the command
if(facid<0) return SendClientMessage(playerid, color,"You have not been invited to any faction.");
SystemX is offline   Reply With Quote
Old 26/05/2016, 09:56 AM   #20
AliBro
Big Clucker
 
Join Date: Aug 2015
Location: San Fierro
Posts: 52
Reputation: 7
Default Re: Faction system [Y_INI]

forum.sa-mp.com/showthread.php?t=390214 --- you just use this tutorial and u idn't change any thing u just replace gang to Faction LMFAO
__________________

Last edited by AliBro; 26/05/2016 at 12:35 PM.
AliBro 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
[FilterScript] [Request]Dynaimc Faction System and Crates System Doros Filterscripts 6 05/11/2017 05:48 PM
[FilterScript] Cross Admin System V1.2 [updated] + Added IRC System + Anti Cheat(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 21 02/01/2013 06:32 PM
[FilterScript] Cross Admin System V1.1 [updated] + Added V.I.P System(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 8 10/09/2012 11:18 AM
Way to make a Simple Faction system with Y_INI? seanny Scripting Help 0 16/10/2011 12:25 PM


All times are GMT. The time now is 04:55 PM.


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