02.03.2014, 17:18
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
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
// code from your /flip command to flip the vehicle..
}
return 1;
}
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;
}