07.06.2013, 00:53
Preciso colocar Ctrl para ligar e desligar o motor dos carros, jб tentei tudo e nгo consigo... quem puder ajudar agradeзo!!!
public Startup(playerid, vehicleid)
public Startup(playerid, vehicleid)
PHP код:
else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !IsASalesVehicle(newcar))
{
SendClientMessage(playerid, COLOR_GREEN, "Atencao! Use /ingnicao ou pressione SHIFT para ligar o carro!");
TogglePlayerControllable(playerid, false);
vehicleEntered[playerid][vehicleid] = true;
}
PHP код:
if(!strcmp(cmd, "/ingnicao", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new idcar = GetPlayerVehicleID(playerid);
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999 || IsASalesVehicle(idcar))
return SendClientMessage(playerid, COLOR_GREY,"* Voce nao pode ligar esse carro!");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gira a chave e tentar ligar o motor do veнculo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Dando ingnicao no carro...",3500,3);
gEngine[playerid] = 1;
return 1;
}
else if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* Voce nao pode desligar esse carro!");
format(string, sizeof(string), "* %s gira a chave e desliga o motor do veнculo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5,COLOR_GRAD5);
GameTextForPlayer(playerid, "~w~Tirando a chave do carro.",3500,3);
gEngine[playerid] = 0;
TogglePlayerControllable(playerid, 0);
return 1;
}
}
}
return 1;
}