Car wont get thrown
#1

The car isn't getting throwed!!!
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;
}
Reply
#2

Bump?
abcd
Reply
#3

Do I have to do a FUCKING SUPER BUMP??
Reply
#4

You're only allowed to bump once every 24 hours.
Reply
#5

o.o k
Reply
#6

Read the wiki: https://sampwiki.blast.hk/wiki/SetVehicleVelocity
Clearly stated, function dont affect un occupied vehicles.
In case use SetVehiclePos or maybe NPC.
Reply
#7

HOWE NPC!!~~~!!~!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)