flip when pressing mmb
#1

i made a code to flip a car when pressing mmb but for some reason it isnt working;

Код:
		if(newkeys == KEY_LOOK_BEHIND)

	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			{
			new Float:PX, Float:PY, Float:PZ, Float:PA;
			GetPlayerPos(playerid, PX, PY, PZ);
			GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
			SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
			SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
			SendClientMessage(playerid, COLOR_GREEN,"Vehicle Fliped!");
			PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
			}
		}
	}
can someone please help?
Reply
#2

well you're getting the angle of the vehicle and then setting it as that angle.
PA += 180;
if(PA > 360) PA -= 360;
and then set the angle
Reply
#3

the flipping works, i tryd it in a command. when i press mmb it wont flip my car and doesnt send the clientmessage
Reply
#4

ok give this a read, it says what you're doing wrong https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#5

You cant use MMB as a 'KEY_(....)' It's impossible.
Reply
#6

mmb =key_look_behind standart in san andreas..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)