10.03.2008, 18:43
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.
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; } } }