SA-MP Forums Archive
Gates whose opens with player name - 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: Gates whose opens with player name (/showthread.php?tid=539111)



Gates whose opens with player name - Hotbrain - 26.09.2014

Hello, i would like to know how to do this:
Make gates, which opens only if player name is written in script and player IG writes down command.

PS. Im sorry i cant write more in description, english isnt my native.. :/


Re: Gates whose opens with player name - Abagail - 26.09.2014

Just do something like this,
CMDpengate(playerid, params[])
{
// bla bla bla
new name[24];
GetPlayerName(playerid, name, 24);
if(!strcmp(name, "name_open", true))
{
// Open the gate here...
}
}


Basically, use strcmp to compare the name, and if it matches what you want it to open the gate.