Little 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little Help (
/showthread.php?tid=135232)
Little Help -
playbox12 - 19.03.2010
Hi,
I searched on ****** and forums, but i cant find an topic about this (if you know one just give the link).
This is what i want. (i mean the fence doesen't need to open with an command i mean you just will be teleported to the other side, like Los Santos Prison (LSP) in (LSRP)
Example: there is an gate you type /enter and you and you car will be teleported to the other side of the fence
Current code:
Код:
if(strcmp(cmd, "/enter2", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
SetPlayerPos(playerid, -1833.2200, -16.1694, 15.1172);// zoek
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(currentveh, vehx, vehy, vehz);
SetVehiclePos(371, -1833.2200, -16.1694, 15.1172);
return 1;
}
}
return 1;
}
But it has some problems you see
Код:
SetVehiclePos(371, -1833.2200, -16.1694, 15.1172);
i need to define all the vehicle models, so is there a way that you can teleport with every vehicle i dont want to define every vehicle model.
Second when you teleport you will be spawned next to your car is there a way you teleport back in to your car, plus the passengers.
Re: Little Help -
playbox12 - 19.03.2010
deleted
Re: Little Help -
playbox12 - 20.03.2010
Bump, please i can't find it. It probaly would be a basic thing but i dont know it
Re: Little Help -
MadeMan - 20.03.2010
pawn Код:
if(strcmp(cmd, "/enter2", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), -1833.2200, -16.1694, 15.1172);
}
else
{
SetPlayerPos(playerid, -1833.2200, -16.1694, 15.1172);
}
return 1;
}
}
return 1;
}
Re: Little Help -
playbox12 - 20.03.2010
Great it works now, awesome
Only one question left, i want that command useable only in an certain area, i mean i want that you can only type that infront of the gate, not everywhere
Re: Little Help -
biltong - 20.03.2010
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
Re: Little Help -
playbox12 - 20.03.2010
Quote:
|
Originally Posted by biltong
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
|
Nice, it works thank you.