09.06.2011, 13:06
Hello, I am having trouble with my /engine bug. If I leave another cars engine on and then enter another car and do /engine it says "Luis_Foxx turns off the vehicle", instead of "Luis_Foxx turns on the vehicle."..
pawn Код:
CMD:engine(playerid, params[])
{
new vid = GetPlayerVehicleID(playerid);
new Message[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not in a vehicle.");
if(vid != INVALID_VEHICLE_ID)
{
if(engine == 0)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
format(Message, sizeof(Message), "* %s turns on the vehicles engine.", name);
nearByMessage(playerid, COLOR_PURPLE, Message);
engine = 1;
}
else if(engine == 1)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
format(Message, sizeof(Message), "* %s turns off the vehicles engine.", name);
nearByMessage(playerid, COLOR_PURPLE, Message);
engine = 0;
}
}
return 1;
}