30.11.2011, 03:48
Hey.. I'm trying to make that you wont have to type /engine if you drive bicycles... well I tried to make a foward + public of the vehiclemodel but it didnt help.. the last thing I tried is that:
and my /engine command:
pawn Код:
on:
public OnPlayerStateChange(playerid, newstate, oldstate)
if(GetVehicleModel(newcar) == 481 || GetVehicleModel(newcar) == 509 || GetVehicleModel(newcar) == 510)//BMX
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
return 1;
}
and my /engine command:
pawn Код:
if(!strcmp(cmd, "/engine", true))
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s puts the keys and turn on the engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(engine == 1)
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Turn off the engine and take the keys.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
}
return 1;
}