[Help] Simple /enter /exit Code - 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: [Help] Simple /enter /exit Code (
/showthread.php?tid=176939)
[Help] Simple /enter /exit Code -
FrankC - 15.09.2010
Ive tryed to replace my current /enter /exit command at the moment its
C so when you press C you enter the building and the same for exit
i wanna change that to /enter and /exit but can't really make the code
so can anyone send the code?
Re: [Help] Simple /enter /exit Code -
Mauzen - 15.09.2010
Ehm, go to OnPlayerKeyStateChange, look for KEY_CROUCH or 2, and copy the code you got there. Then put it to OnPlayerCommandText in a command check like the others that are there
Re: [Help] Simple /enter /exit Code -
FrankC - 15.09.2010
Quote:
Originally Posted by Mauzen
Ehm, go to OnPlayerKeyStateChange, look for KEY_CROUCH or 2, and copy the code you got there. Then put it to OnPlayerCommandText in a command check like the others that are there
|
Okay thanks for quick respond..
but i go to OnPlayerKeyStateChange and find KEY_CROUCH and i copy the code:
Код:
#define KEY_CROUCH (2)
Is that the right code? and where do i replace the C to /enter and /exit Commands
Dont really understand sorry..
Re: [Help] Simple /enter /exit Code -
wups - 15.09.2010
please paste the code, where OnPlayerKeyStateChange is KEY_CROUCH function.
Re: [Help] Simple /enter /exit Code -
FrankC - 15.09.2010
Using this code now but is there a problem in the code?
Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1772.4011,-1548.4357,9.9063) {
SetPlayerInterior(playerid, /10/);
SetPlayerPos(playerid, 1808.6891,-1312.6675,197.1969);
return 1;
}
}
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1810.3650,-1312.7653,197.1969) (
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1770.2963,-1546.3507,9.9260);
return 1;
}
}