13.03.2012, 22:15
I gots This
After Engine starts i want an automatic /me ,%s(Player name) spins the %s(car name)'s key into the ignition and turns on the engine.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(vehEngine[vehicleid] == 0)
{
if(newkeys == KEY_JUMP)
{
vehEngine[vehicleid] = 2;
SetTimerEx("StartEngine", 3000, 0, "i", playerid);
SendClientMessage(playerid, 0x33AA33AA, "Vehicle engine starting");
}
}
if(newkeys == KEY_SECONDARY_ATTACK)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
return 1;
}