Change /engine command to n key
#4

This

Quote:

CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //This here is checking if the player is inside a vehicle as a driver.
{
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehicle = GetPlayerVehicleID(playerid); //This part here is defining the vehicle ID that the player is currently in.
new pname[24], string[100], vehicleid, enginestatus[4];
pname = GetName(playerid);
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
if(VEngine[vehicle] != 1) //This is checking if the engine of the vehicle, is turned off or not.
{
VEngine[vehicle] = 0;
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
}
else
{
VEngine[vehicle] = 1;
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerToPlayer(playerid,i,7))
{
if(VEngine[vehicle] == 0) { enginestatus = "Off"; }
else if(VEngine[vehicle] == 1) { enginestatus = "On"; }
new model = GetVehicleModel(vehicleid);
strreplace(pname, '_', ' ');
format(string, sizeof(string), "* %s has turned the engine of his %s %s *", pname, VehicleNames[model - 400], enginestatus);
SendClientMessage(i, COLOR_PURPLE, string);
}
}
}
else return SendClientMessage(playerid, COLOR_WHITE, "You are not driving a vehicle!");
return 1;
}

Reply


Messages In This Thread
Change /engine command to n key - by mertcan123 - 13.09.2015, 01:11
Re: Change /engine command to n key - by TwinkiDaBoss - 13.09.2015, 02:01
Re: Change /engine command to n key - by mertcan123 - 13.09.2015, 07:45
Re: Change /engine command to n key - by Bolex_ - 13.09.2015, 08:00
Re: Change /engine command to n key - by J0sh... - 13.09.2015, 08:05
Re: Change /engine command to n key - by Bolex_ - 13.09.2015, 08:14
Re: Change /engine command to n key - by Logofero - 13.09.2015, 08:23
Re: Change /engine command to n key - by Michael B - 13.09.2015, 08:32
Re: Change /engine command to n key - by mertcan123 - 13.09.2015, 08:47
Re: Change /engine command to n key - by Michael B - 13.09.2015, 09:46

Forum Jump:


Users browsing this thread: 1 Guest(s)