28.04.2018, 16:45
Hello samp
I've issue when some vips or admins spawn vehicle some time there vehicle sometime destroyed even they didn't spawned any car before.
this is also sometime happen like i am driving spawned vehicle another admin/vip spawn vehicle mine vehicle got destroyed and some time his vehicle spawned and destroyed quickly.
Kindly help me out thanks.
I've issue when some vips or admins spawn vehicle some time there vehicle sometime destroyed even they didn't spawned any car before.
this is also sometime happen like i am driving spawned vehicle another admin/vip spawn vehicle mine vehicle got destroyed and some time his vehicle spawned and destroyed quickly.
Код:
under OnPlayerConnect(playerid) pInfo[playerid][LastSpawnedCar] = INVALID_VEHICLE_ID CMD:bike(playerid)return GiveVehicle(playerid,522); public GiveVehicle(playerid,vehicleid) { if(pInfo[playerid][LastSpawnedCar] != INVALID_VEHICLE_ID) { DestroyVehicle(pInfo[playerid][LastSpawnedCar]); GivePlayerVehicle(playerid,vehicleid); } if(pInfo[playerid][LastSpawnedCar] == INVALID_VEHICLE_ID) { GivePlayerVehicle(playerid,vehicleid); } return 1; } GivePlayerVehicle(playerid,vehicleid) { new Float:x, Float:y, Float:z, Float:angle; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); new veh = CreateVehicle(vehicleid, x, y, z, angle, -1, -1, -1); SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(veh, GetPlayerInterior(playerid)); SetVehicleHealth(veh,999); PutPlayerInVehicleEx(playerid, veh, 0); pInfo[playerid][LastSpawnedCar] = veh; return 1; }