pawn Код:
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new engine,lights,alarm,doors,bonnet,boot,objective;
if(strcmp(cmd, "/engineon",true) == 0)
{
new veiculoid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid)) {
GetVehicleParamsEx(veiculoid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON) {
SendClientMessage(playerid,0x800000AA,"engine is on");
return 1;
}
else {
SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x008040AA," engine on");
}
}
else {
SendClientMessage(playerid,0x800000AA," you're not in a vehicle");
}
return 1;
}
if(strcmp(cmd, "/engineoff",true) == 0)
{
new veiculoid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid)) {
GetVehicleParamsEx(veiculoid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_OFF) {
SendClientMessage(playerid,0x800000AA," engine is already off");
return 1;
}
else {
SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x008040AA," engine off");
}
}
else {
SendClientMessage(playerid,0x800000AA," you're not inside a vehicle");
}
return 1;
}