SA-MP Forums Archive
[HELP] - Automatic gates open only by specific players?! - 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: [HELP] - Automatic gates open only by specific players?! (/showthread.php?tid=426015)



[HELP] - Automatic gates open only by specific players?! - Riven - 27.03.2013

Hello guys..
well , im just a beginner and new for pawno etc.. i've finally done making automatic gates that opens with a (key)
but my next question is how can i make only a specific player can open it ..

the gate opens when u are without a vehicle with RightClick and when u are in a vehicle it opens with Space key.

i mean.. not everyone can open that gate. only the ones who i choose from Mysql or what ever..

NOTE : I'm Using MySQL system , not just normal files.


Re: [HELP] - Automatic gates open only by specific players?! - FunnyBear - 27.03.2013

Quote:
Originally Posted by Riven
Посмотреть сообщение
Hello guys..
well , im just a beginner and new for pawno etc.. i've finally done making automatic gates that opens with a (key)
but my next question is how can i make only a specific player can open it ..

the gate opens when u are without a vehicle with RightClick and when u are in a vehicle it opens with Space key.

i mean.. not everyone can open that gate. only the ones who i choose from Mysql or what ever..

NOTE : I'm Using MySQL system , not just normal files.
Do you have teams?


Re: [HELP] - Automatic gates open only by specific players?! - Riven - 27.03.2013

well. no :3 , after i learn a little more , i would make teams .


Re: [HELP] - Automatic gates open only by specific players?! - Saw® - 27.03.2013

Add just a condition or just like
pawn Код:
if(/*the way you cheking the player pos && gTeam[playerid]=1 or 2....*/)
ex:
Код:
if(IsPlayerPos(playerid,x,y,z) && TheTeamThatCanUseTheKey)
&&= and.


Re: [HELP] - Automatic gates open only by specific players?! - MP2 - 27.03.2013

Use my include (mGates). Makes this so easy. See my signature.


Re: [HELP] - Automatic gates open only by specific players?! - judothijs - 27.03.2013

Well, use the only static unique thing players got; their name!

pawn Код:
string Name = "Tommy";

if(strcmp(getPlayerName(playerid, sizeof(name)), Name) == 0;
{
    // open gate
}
Probably not 100% Pawn correct, but idea should be clear.


Re: [HELP] - Automatic gates open only by specific players?! - Riven - 28.03.2013

well guys .. you gave me nice tips for that , but what i mean is i have accounts in my MySQL database. isn't there a way to let it select the accounts for that or something? , thanks again : )


Re: [HELP] - Automatic gates open only by specific players?! - Omirrow - 28.03.2013

pawn Код:
if(bla bla bla..)
You must enter a distinguishing feature