Asking a thing... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Asking a thing... (
/showthread.php?tid=327116)
Asking a thing... -
Face9000 - 19.03.2012
Hello guys,since im developing a cops&robbers gamemode,i need help with a thing.
I need to save the team choose the FIRST time when a player spawn,and after he quit and rejoin,he cant select other teams except the first selected...how to ?
Re: Asking a thing... -
Jonny5 - 20.03.2012
how are you saving and loading your data?? ini, djson, mysql?
if your good at scripting then a basic instruction is all ya need so ill try,
I would set a flag when a player goes to register,
something like:
in the gamemode under the includes and above any callbacks use
pawn Код:
new bool:Player_Can_Select_Team[MAX_PLAYERS];
then in the code block you have setup for when they register
add
pawn Код:
Player_Can_Select_Team[playerid]=true;
then do a simple check before letting them select a team
pawn Код:
if(Player_Can_Select_Team[playerid]){
Player_Can_Select_Team[playerid] = false;
// select team code here
}
the idea is this happens when they reg, after they reg they have a flag set to select a team,
otherwise they must use there current team.
now this does not cover setting the team
also does not cover getting the first selected team for an ini,djson,mysql db
hope this helps,
Re: Asking a thing... -
Haydz - 20.03.2012
What type of saving method are you using?
Re: Asking a thing... -
Face9000 - 20.03.2012
Quote:
Originally Posted by Haydz
What type of saving method are you using?
|
I use Y_INI.
Quote:
Originally Posted by Jonny5
//Cut
|
Thanks for help but i use Y_INI and i need to setup how..
Re: Asking a thing... -
Face9000 - 21.03.2012
bump
Re: Asking a thing... -
brett7 - 21.03.2012
Your better off using mysql for this.
Re: Asking a thing... -
Face9000 - 21.03.2012
Quote:
Originally Posted by brett7
Your better off using mysql for this.
|
Well,i started the gm from scratch using Y_INI and i want continue using that.
Re: Asking a thing... -
Face9000 - 22.03.2012
bump
Re: Asking a thing... -
Face9000 - 24.03.2012
Bump.Any help?