02.06.2012, 22:45
pawn Код:
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new engine,lights,alarm,doors,bonnet,boot,objective;
if(strcmp(cmd, "/ligarmotor",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," O Veiculo jб estб ligado!");
return 1;
}
else {
SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x008040AA," Motor Ligado.");
}
}
else {
SendClientMessage(playerid,0x800000AA," Vocк nгo estб em um veiculo!");
}
return 1;
}
if(strcmp(cmd, "/desligarmotor",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," O Veiculo jб estб desligado!");
return 1;
}
else {
SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid,0x008040AA," Motor Desligado.");
}
}
else {
SendClientMessage(playerid,0x800000AA," Vocк nгo estб em um veiculo!");
}
return 1;
}