SA-MP Forums Archive
zGaming help - 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: zGaming help (/showthread.php?tid=389168)



zGaming help - Ryan_Michael - 01.11.2012

I need to know how I can set my doors and stuff that I use /enter and /exit to press F or ENTER.
Let me know ASAP thanks.


Re: zGaming help - Dusan01 - 01.11.2012

First Find:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
and add this:
Код:
f( newkeys == KEY_SECONDARY_ATTACK ) //  KEY_SECONDARY_ATTACK if player fres F
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, X enter, Y enter, Z enter ) ) // if player to point
{
SetPlayerPos( playerid, X, r, Z ); // X, Y, Z -where player is gonna to spawn
SetPlayerInterior( playerid, 15 ); // ID of int
GameTextForPlayer( playerid, "TEXT", 3000, 1 ); // send player message
return 1; 
}
}
and add this afther when u added first(this now is for exit):
Код:
if( newkeys == KEY_SECONDARY_ATTACK ) // if player press F or enter
{
if( IsPlayerInRangeOfPoint( playerid, 3.0,  x exit, y ext, z exit ) ) // if player to point 
SetPlayerPos( playerid, X, Y, Z ); // pos where player is gonna to spawn
SetPlayerInterior( playerid, 0); //DI int...
GameTextForPlayer( playerid, "TEXT", 3000, 1 ); // TEXT
return 1; 
}
}
and also u can add TextLabels:

first find:
Код:
public OnGameModeInit()
and add: [CODE]Create3DTextLabel("For Enter to the buidling | press Enter",COLOR, x, y, z); // x,y,z enter
Create3DTextLabel("For Exit | press Enter",COLOR, x, y, z); //x,y,z exit


Re: zGaming help - Ryan_Michael - 01.11.2012

Thank you