SA-MP Forums Archive
[Ajuda] Ajuda simples - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Ajuda simples (/showthread.php?tid=391725)



Ajuda simples - Vinicius_TroLL - 11.11.2012

O que eu devo fazer para sу o motorista ligar o veiculo ?
pawn Код:
if(strcmp("/motor",cmdtext,true,6)==0)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid,COLOR_GREY,"Vocк precisa estar em um veнculo!");
            return 1;
        }
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);

        new vid = GetPlayerVehicleID(playerid);
        if(Gas[vid] == 0)
                return SendClientMessage(playerid,COLOR_GRAD2," Veiculo sem Combustivel");
        if(LigadoDesligado2[vid] == 1)
        {
            motor[playerid] = 1;
        }
        if(LigadoDesligado2[vid] == 0)
        {
            motor[playerid] = 0;
        }
        if(carro != INVALID_VEHICLE_ID)
        {
            if(motor[playerid] == 0)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
                motor[playerid] = 1;
                LigadoDesligado2[carro] = 1;
                SendClientMessage(playerid, COLOR_WHITE, "Motor do veiculo {00eaff}ligado");
            }
            else
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
                motor[playerid] = 0;
                LigadoDesligado2[carro] = 0;
                SendClientMessage(playerid, COLOR_WHITE, "Motor do veiculo {00eaff}desligado");
            }
        }
        return 1;
    }



Re: Ajuda simples - .FuneraL. - 11.11.2012

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
      //Aзгo
}



AW: Ajuda simples - Vinicius_TroLL - 11.11.2012

Vlw cara sу mais uma coisa, como eu faзo para aparecer essa mensagem sу para o motorista tb?
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "Para Ligar/Desligar o veнculo aperte {00eaff}ALT");
Coloquei ela na public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) mais mesmo se entrar de G aparece ela


Re: Ajuda simples - VenoN - 11.11.2012

cOLOQUE A MENSAGEN DENTRO DO PLAYER STATE DRIVE


AW: Ajuda simples - Vinicius_TroLL - 11.11.2012

Ja tentei n foi


Re: AW: Ajuda simples - Sky™ - 11.11.2012

Quote:
Originally Posted by Vinicius_TroLL
Посмотреть сообщение
Ja tentei n foi
simples..


pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
    {
        SendClientMessage(playerid, COLOR_WHITE, "Para Ligar/Desligar o veнculo aperte {00eaff}ALT");
    }



AW: Ajuda simples - Vinicius_TroLL - 11.11.2012

Vou testar mais ja vou dar Rep pra todos q me ajudaram ou tentaram ajudar


Re: Ajuda simples - VenoN - 11.11.2012

nгo precisa testar
essa й a mais pura logica kk!

eu sу tinha esquecido que sу Funcionaria no OnplayerstateChange kkk