flip when pressing mmb - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: flip when pressing mmb (
/showthread.php?tid=146596)
flip when pressing mmb -
swredder - 08.05.2010
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?
Re: flip when pressing mmb -
cessil - 08.05.2010
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
Re: flip when pressing mmb -
swredder - 08.05.2010
the flipping works, i tryd it in a command. when i press mmb it wont flip my car and doesnt send the clientmessage
Re: flip when pressing mmb -
cessil - 08.05.2010
ok give this a read, it says what you're doing wrong
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: flip when pressing mmb -
Mujib - 08.05.2010
You cant use MMB as a 'KEY_(....)' It's impossible.
Re: flip when pressing mmb -
swredder - 08.05.2010
mmb =key_look_behind standart in san andreas..