CMD:engine(playerid, params[]) {
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_RED, "You have to be the driver!");
new engine, lights, alarm, doors, bonnet, boot, objective;
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
strreplace(pname, '_', ' ');
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if (!engine) {
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, 1, alarm, doors, bonnet, boot, objective);
format(str, sizeof(str), "* %s attempts to turn on the engine, and succeeds", pname);
ProxDetector(30.0, playerid, str, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
} else if (engine) {
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 0, alarm, doors, bonnet, boot, objective);
format(str, sizeof(str), "* %s attempts to turn off the engine, and succeeds", pname);
ProxDetector(30.0, playerid, str, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
}
return 1;
}
!
stock RPNU(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
CMD:engine(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid, string[128];
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine)
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s attempts to turn on the engine, and succeeds", RPNU(playerid));
ProxDetector(30.0, playerid, str, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
}
else
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s attempts to turn off the engine, and succeeds", RPNU(playerid));
ProxDetector(30.0, playerid, str, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
}
return 1;
}
.SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
.
its starting with shift or /engline i want with 2
if(!engine)
if(engine != 1)
|
Verbal, no need to do what iRage said to do.
Instead of: pawn Код:
pawn Код:
|