Quote:
Originally Posted by jamesbond007
what angle does it set it at? random or 0 ?
does it happen to all vehicles ? idk.. maybe someone else will reply with solution
|
Well yeah with all vehicles but only if I use SetVehicleToRespawn
Quote:
Originally Posted by Threshold
Where exactly are you respawning it?
|
I got a command which is basically SetVehicleToRespawn(playerid,GetPlayerVehicleID(pl ayerid))
Quote:
Originally Posted by Kevln
pawn Код:
// ** INCLUDES
#include <a_samp> #include <zcmd>
// ** ARRAYS AND ENUMERATORS
enum eVehicleInfo { Float:vehicle_info_x, Float:vehicle_info_y, Float:vehicle_info_z, Float:vehicle_info_angle };
new aVehicleInfo[MAX_VEHICLES][eVehicleInfo];
// ** MAIN
main() { print("Loaded \"vehicle_angle.amx\"."); }
// ** CALLBACKS
public OnGameModeInit() { new vehicleid = AddStaticVehicle(400, 132.1159, -92.7907, 1.5220, 291.6237, 123, 1);
GetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]); GetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]); return 1; }
public OnGameModeExit() { return 1; }
public OnVehicleSpawn(vehicleid) { SetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]);
SetTimerEx("SetVehicleZAngleAfterSpawn", 1500, false, "i", vehicleid); return 1; }
// ** COMMANDS
CMD:respawnvehicles(playerid, params[]) { for(new i = 1, j = GetVehiclePoolSize(); i <= j; i ++) { SetVehicleToRespawn(i); } return 1; }
CMD:park(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); GetVehiclePos(vehicleid, aVehicleInfo[vehicleid][vehicle_info_x], aVehicleInfo[vehicleid][vehicle_info_y], aVehicleInfo[vehicleid][vehicle_info_z]); GetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]); return 1; }
// ** FUNCTIONS
forward SetVehicleZAngleAfterSpawn(vehicleid); public SetVehicleZAngleAfterSpawn(vehicleid) { SetVehicleZAngle(vehicleid, aVehicleInfo[vehicleid][vehicle_info_angle]); return 1; }
|
Ill try it out
EDIT: Yeah that works just fine, probably Ill have to do it like this sometimes. Thanks for the help. +rep