21.12.2012, 14:30
Код:
new SpawnCar[MAX_PLAYERS]; GiveVehicle(playerid, modelid) { new Auto, Float:x,Float:y,Float:z,Float:angulo; if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { Auto = GetPlayerVehicleID(playerid); GetVehiclePos(Auto, x, y, z); GetVehicleZAngle(Auto, angulo); DestroyVehicle(Auto); } else { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angulo); } if(SpawnCar[playerid] != 0) DestroyVehicle(SpawnCar[playerid]); SpawnCar[playerid] = CreateVehicle(modelid,x,y,z,angulo,-1,-1,60); PutPlayerInVehicle(playerid,SpawnCar[playerid],0); LinkVehicleToInterior(SpawnCar[playerid], GetPlayerInterior(playerid)); SetVehicleVirtualWorld(SpawnCar[playerid], GetPlayerVirtualWorld(playerid)); return 1; }