21.07.2011, 03:30
(
Последний раз редактировалось Sledge; 21.07.2011 в 17:54.
)
pawn Код:
command(engine, playerid, params[])
{
#pragma unused params
new string[128];
SendClientMessage(playerid, WHITE, "pragma unsued params");
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, WHITE, "Isplayerinanyvehicle");
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, WHITE, "playeR_state_driver");
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(EngineOn[vehicleid] == 0) //turn off
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s starts the engine of the %s", GetName(playerid), VehicleNames[vehicleid-400]);
NearByMessage(playerid, NICESKY, string);
EngineOn[vehicleid] = 1;
}
else if(EngineOn[vehicleid] == 1) //turn on
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s stops the engine of the %s", GetName(playerid), VehicleNames[vehicleid-400]);
NearByMessage(playerid, NICESKY, string);
EngineOn[vehicleid] = 0;
}
}
}
return 1;
}