20.03.2015, 08:32
The car isn't getting throwed!!!
But it do spawns and gets removed by its time after being exploded. but dosent throws!
Code:
But it do spawns and gets removed by its time after being exploded. but dosent throws!
Code:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new Float:xx, Float:xy, Float:xz; if(PRESSED(KEY_FIRE)) { if(throwing[playerid] == 1) { new Float:vx, Float:vy, Float:vz, Float:vangle, color1, color2, respawn_delay; color1 = random(256), color2 = random(256), respawn_delay = -1; GetPlayerPos(playerid, vx, vy, vz); GetPlayerFacingAngle(playerid, vangle); new throwveh = CreateVehicle(402, Float:vx, Float:vy, Float:vz, Float:vangle, color1, color2, respawn_delay); GetVehicleVelocity(throwveh, xx, xy, xz); SetVehicleVelocity(throwveh, xx+(xx / 5), xy+(xy / 5), xz+(xz / 5)); SetVehicleHealth(throwveh, 150.0); SetTimerEx("RemoveVehicle", 6500, false, "d", throwveh); } } if(HOLDING(KEY_FIRE)) { if(throwing[playerid] == 1) { ThrowingV[playerid] = SetTimerEx("ThrowingVeh", 1250, true, "d", playerid); } } else if(RELEASED(KEY_FIRE)) { if(throwing[playerid] == 1) { KillTimer(ThrowingV[playerid]); } } return 1; } public ThrowingVeh(playerid) { new Float:xx, Float:xy, Float:xz; new Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay; color1 = random(256), color2 = random(256), respawn_delay = -1; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); new throwveh = CreateVehicle(402, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay); GetVehicleVelocity(throwveh, xx, xy, xz); SetVehicleVelocity(throwveh, xx+(xx / 4), xy+(xy / 4), xz+(xz / 4)); SetVehicleHealth(throwveh, 150.0); SetTimerEx("RemoveVehicle", 6500, false, "d", throwveh); return 1; }