Flip car - 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)
+--- Thread: Flip car (
/showthread.php?tid=498270)
Flip car -
Dipto - 02.03.2014
Can anyone give me a script for flip car, i made one, but i have to do /flip, for flip. but i want a script like, when i press 2 it will flip the car. please someone give me
Re: Flip car -
Vasu99 - 02.03.2014
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: Flip car -
Dipto - 02.03.2014
thanks vasu99... thanks
but can u give me the script for that, please ( press 2 for flip car ) ?
Re: Flip car -
Konstantinos - 02.03.2014
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
// code from your /flip command to flip the vehicle..
}
return 1;
}
Re: Flip car -
Dipto - 02.03.2014
thanks for reply, but showing me error bro, i m new so i dont no how to fix,
Re: Flip car -
Konstantinos - 02.03.2014
Quote:
Originally Posted by Dipto
thanks for reply, but showing me error bro, i m new so i dont no how to fix,
|
Post the error and the lines of code the error is given.
Re: Flip car -
Dipto - 02.03.2014
never mind bro, can u make the code, just make press 2 for flip car, make a filterscript please
Re : Flip car -
mirou123 - 02.03.2014
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF, "You are not inside any vehicle.");
new Float:ZAngle,Float:X,Float:Y,Float:Z,vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehiclePos(vehicleid,X,Y,Z);
GetVehicleZAngle(vehicleid,ZAngle);
SetVehicleZAngle(vehicleid,ZAngle);
SetVehiclePos(vehicleid,X,Y,Z+2);
}
return 1;
}
Re: Flip car -
MP2 - 03.03.2014
You might want to check if they're a driver too, so passengers can't flip the vehicle.