SA-MP Forums Archive
[Ajuda] Dъvida curta. - 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] Dъvida curta. (/showthread.php?tid=462615)



Dъvida curta. - Ley - 07.09.2013

Boa Noite, estou com um pequeno problema na verificaзгo quando um player entra em um veнculo.
Irei logo ao assunto.

PHP код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 586
{
      if(
InfoPlayer[playerid][Profissao] == profissao|| IsPlayerAdmin(playerid)) 
      {
      
TogglePlayerControllable(playeridtrue); 
      }
        else 
      {
          
RemovePlayerFromVehicle(playerid);
          
SCM(playerid, -1"Esse veнculo pertence aos zoeiros HU3.");
          return 
1
          }

O problema, й que mesmo um player entrando como carona no veнculo, a verificaзгo й ativada e ele й ejetado do mesmo.
Alguйm poderia me ajudar?


Re: Dъvida curta. - Coe1 - 07.09.2013

Coloca na OnPlayerStateChange e checa se ele entrou como passageiro ou como motorista.


Re: Dъvida curta. - Ley - 07.09.2013

Quote:
Originally Posted by Coe1
Посмотреть сообщение
Coloca na OnPlayerStateChange e checa se ele entrou como passageiro ou como motorista.
Obviamente essa й a ideia, e se eu soube-se a funзгo, eu nгo viria perguntar aqui '-'


Re: Dъvida curta. - darkxdll - 07.09.2013

PHP код:
if(newstate == PLAYER_STATE_PASSENGER



Re: Dъvida curta. - Coe1 - 07.09.2013

Santa ignorвncia...

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
       
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 586)  
        {
             
            if(InfoPlayer[playerid][Profissao] == profissao|| IsPlayerAdmin(playerid))  
            {
                 
                TogglePlayerControllable(playerid, true);  
            }
            else  
            {
                 
                RemovePlayerFromVehicle(playerid);
                SCM(playerid, -1, "Esse veнculo pertence aos zoeiros HU3.");
                return 1;  
            }
        }  
    }
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER)
    {
       
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 586)  
        {
             
            if(InfoPlayer[playerid][Profissao] == profissao|| IsPlayerAdmin(playerid))  
            {
                 
                TogglePlayerControllable(playerid, true);  
            }
            else  
            {
                 
                //RemovePlayerFromVehicle(playerid);
                SCM(playerid, -1, "vc entrou como passageiro no veiculo do naoseioq");
                return 1;  
            }
        }  
    }
    return 1;
}
¬¬'


Re: Dъvida curta. - WLSF - 07.09.2013

Quote:
Originally Posted by Ley
Посмотреть сообщение
Obviamente essa й a ideia, e se eu soube-se a funзгo, eu nгo viria perguntar aqui '-'
Se a ideia й essa porque nгo especificou no inicio ao invйs de ser arrogante ?

Se tu nгo sabe uma coisa tгo simples assim, entгo nгo sabe nada, devia procurar no ****** parceiro, "essa й a ideia" primeiro usar search/****** e depois vir criar tуpicos...

Jб leu as regrinhas ?

Toma ai: http://lmgtfy.com/?q=como+verificar+OnPlayerStateChange