13.11.2015, 20:33
Hello i am trying to code :
when player dies and the player is not in the safe zone then player vehicle position should be saved and respawned at the same place everytime until he changes the position manualy
here is my code
but its not working
when player dies and the player is not in the safe zone then player vehicle position should be saved and respawned at the same place everytime until he changes the position manualy
here is my code
PHP код:
//onplayerdeath
if(!IsPlayerInDynamicArea(playerid, safezone))
{
new Float:x, Float:y, Float:z, Float:a;
if(PlayerInfo[playerid][pVehicle1] != 0)
{
GetVehiclePos(car1[playerid], x, y, z);
GetVehicleZAngle(car1[playerid], a);
PlayerInfo[playerid][pVehicle1X] = x;
PlayerInfo[playerid][pVehicle1Y] = y;
PlayerInfo[playerid][pVehicle1Z] = z;
PlayerInfo[playerid][pVehicle1C] = a;
DestroyVehicle(car1[playerid]);
car1[playerid] = CreateVehicle(PlayerInfo[playerid][pVehicle1Model], Float:x, Float:y, Float:z, Float:a, PlayerInfo[playerid][pVehicle1Color1], PlayerInfo[playerid][pVehicle1Color2], 999999);
}
}