Thanks But I'm not a good scripter and that confused me even more... Would someone write this for me please. I usually +1 REP people who help me.
BTY sgtjones12 +1 Thanks for the tip... |
//Add the commands below under public OnPlayerCommandText as you see. public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/enter", cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid, 2.0, 627.4248, -571.8760, 17.8942)) { SetPlayerPos(playerid, -322.197998,302.497985,999.148437); SetPlayerInterior(playerid, 5); // interior id SetPlayerVirtualWorld(playerid, 0); // change this if you want to any VirtualWorld SetCameraBehindPlayer(playerid); } return 1; } if (strcmp("/exit", cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid,2.0, -322.197998,302.497985,999.148437)) { SetPlayerPos(playerid, 627.4248, -571.8760, 17.8942); SetPlayerInterior(playerid, 0);//leave 0 SetPlayerVirtualWorld(playerid, 0); // leave 0 SetCameraBehindPlayer(playerid); return 1; } } return 0; }
Is there a way to make it the enter vehicle exit vehicle key instead of /enter /exit?
|
#include <a_samp>
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SECONDARY_ATTACK))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 627.4248, -571.8760, 17.8942))
{
SetPlayerPos(playerid, -322.197998,302.497985,999.148437);
SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, 0);
SetCameraBehindPlayer(playerid);
}
else if(IsPlayerInRangeOfPoint(playerid,2.0, -322.197998,302.497985,999.148437))
{
SetPlayerPos(playerid, 627.4248, -571.8760, 17.8942);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetCameraBehindPlayer(playerid);
}
}
return 1;
}