Tenta Ai
pawn Код:
// topo
new Motor[MAX_PLAYERS];
new engine,lights,alarm,doors,bonnet,boot,objective;
// OnPlayerConnect(playerid)
Motor[playerid] = 0;
pawn Код:
if(!strcmp(cmd,"/motor",true))
{
if(Motor[playerid] == 0) {
Motor[playerid] = 1;
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, 0x0000FFAA, "[ Veiculo ] {FFFFFF}Veiculo Ligado!");
}
else
{
Motor[playerid] = 0;
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, 0x0000FFAA, "[ Veiculo ] {FFFFFF}Veiculo Desligado! ");
}
return true;
}