SA-MP Forums Archive
How to make gate wich just one player can open? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make gate wich just one player can open? (/showthread.php?tid=108379)



How to make gate wich just one player can open? - buonggiorno - 13.11.2009

Hello to all, i know to make gate wich can open team or organisation, but how to done gate wich just one player can open. For ex. player Oliver_Ben can open that gate and noone else?


Re: How to make gate wich just one player can open? - [XST]O_x - 13.11.2009

http://forum.sa-mp.com/index.php?topic=73014.0
Quote:

<> Commands & Function <>

- There is only one function you can use of this include:

> AddAutoGate(modelid,Float:cX,Float:cY,Float:cZ,Flo at:rX,Float:rY,Float:rZ,FloatX,FloatY,FloatZ ,namecanenter[24],open_distance)

modelid - objectid
cX - closedgate X coord
cY - closedgate Y coord
cZ - closedgate Z coord
rX - rotation X coord
rY - rotation Y coord
rZ - rotation Z coord
oX - opengate X coord
oY - opengate Y coord
oZ - opengate Z coord
namecanenter - Full or Part of the PlayerName of the Player/Clan that can enter
open_distance - radius, in which a player has to be that the gate opens




Re: How to make gate wich just one player can open? - retart441 - 13.11.2009

pawn Код:
new pName[MAX_PLAYER_NAME];
pawn Код:
pName = GetPlayerName(playerid);
Then just make an if statement checking if the person doing the command is the players name.



Re: How to make gate wich just one player can open? - buonggiorno - 13.11.2009

Quote:
Originally Posted by retart441
pawn Код:
new pName[MAX_PLAYER_NAME];
pawn Код:
pName = GetPlayerName(playerid);
Then just make an if statement checking if the person doing the command is the players name.
i know where i need to put new pName...
but where i need to put pName = GetPlayerName(playerid); is that i need to put in name of if(PlayerInfo[playerid] == 5)