Help with exit vehicle while in air. - 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 with exit vehicle while in air. (
/showthread.php?tid=29586)
Help with exit vehicle while in air. -
ShizNator - 10.03.2008
Ok I made a command that if on foot or in car /dive will give you a parachute and add 550 to your Z . It all works fine but when in air with car if i press enter to exit it doesnt until it hits the ground. How can i go around this?
Anyways heres my code for the /dive.
Код:
if(strcmp("/dive", cmdtext, true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new cdid;
cdid = GetPlayerVehicleID(playerid); // Get the vehicle id
new Float:cdx, Float:cdy, Float:cdz; // Variable for vehicle x,y,z
GetVehiclePos(cdid,cdx,cdy,cdz); // Get the vehicle's x,y,z
if(GetPlayerMoney(playerid) > 1000)
{
new Float:cdnz;
cdnz = cdz + 550.0;
GivePlayerMoney(playerid,-1000);
GivePlayerWeapon(playerid,46,1);
SetVehiclePos(cdid,cdx,cdy,cdnz);
SendClientMessage(playerid, COLOR_ORANGE, "** Going Down? Enjoy The Fall **");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "** Don't Have Enough $ **");
return 1;
}
}
else
{
new Float:pdx, Float:pdy, Float:pdz;
new Float:pdnz;
GetPlayerPos(playerid, pdx, pdy, pdz);
pdnz = pdz + 550.0;
if(GetPlayerMoney(playerid) > 1000)
{
GivePlayerMoney(playerid,-1000);
GivePlayerWeapon(playerid,46,1);
SetPlayerPos(playerid,pdx,pdy,pdnz);
SendClientMessage(playerid, COLOR_ORANGE, "** Going Down? Enjoy The Fall **");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "** Don't Have Enough $ **");
return 1;
}
}
}
Re: Help with exit vehicle while in air. -
Dragon1234 - 10.03.2008
pawn Код:
if (strcmp(cmdtext, "/exit", true)== 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Not in a vehicle");
}
return 1;
}
Untested
Re: Help with exit vehicle while in air. -
ShizNator - 23.03.2008
Yeah I tried that example and now what it does is waits til the vehicle is on the ground then it exits. I want to exit while in air.
Re: Help with exit vehicle while in air. -
NuDer - 16.07.2009
type /exit in air