SA-MP Forums Archive
[AJUDA]Restringindo carros. - 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]Restringindo carros. (/showthread.php?tid=287559)



[AJUDA]Restringindo carros. - nefestor - 03.10.2011

Й o seguinte galera, estou restringindo carros de organizaзхes, da seguinte maneira :

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerInVehicle(playerid, carro))
    {
        if(Profissao[playerid] != Taxistas)
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "[Taxistas]Vocк nгo faz parte da nossa organizaзгo");
            return false;
        }
    }
    return true;
}

Funcional ... porйm ele restringe apenas 1 carro dos taxistas, queria saber como restringir todos os carros dos taxistas com essa public ...

Grato desde jб.


Lembrando, o carro ta assim :

pawn Код:
carro=AddStaticVehicleEx(420,1778.25085449,-1887.97802734,13.23803425,270.00000000,6,6,100); //Taxi



Re: [AJUDA]Restringindo carros. - WLSF - 03.10.2011

pawn Код:
//topo
new Taxista[MAX_VEHICLES];
//OnGameModeInit EXEMPLO
    Taxista[0] = AddStaticVehicle................
    Taxista[1] = AddStaticVehicle...............
//OnPlayerStateChange
    for(new x; x<strlen(Taxistas);x++)
    {
        if(GetPlayerVehicleID(playerid) == Taxista[x] && Profissao[playerid] != Taxistas && newstate == PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid,0xFFFFFFAA, "[Taxistas]Vocк nгo faz parte da nossa organizaзгo");
            RemovePlayerFromVehicle(playerid);
            return 1;
        }
    }



Re: [AJUDA]Restringindo carros. - nefestor - 03.10.2011

testando Willian ...


Re: [AJUDA]Restringindo carros. - nefestor - 03.10.2011

1 Erro.

pawn Код:
C:\Users\SHIELD\Desktop\SERVIDOR SAMP\Brasil Intense Live\gamemodes\Untitled.pwn(211) : error 035: argument type mismatch (argument 1)
Linha 211 :
pawn Код:
for(new x; x<strlen(Taxistas);x++)
@Edit : desculpe o double.


Re: [AJUDA]Restringindo carros. - WLSF - 03.10.2011

pawn Код:
for(new x; x<strlen(Taxista);x++)
Pronto tente assim


Re: [AJUDA]Restringindo carros. - nefestor - 03.10.2011

Compilado ...

Testado e aprovado; muito obrigado


Re: [AJUDA]Restringindo carros. - WLSF - 03.10.2011

Disponha.


Re: [AJUDA]Restringindo carros. - nefestor - 03.10.2011

Willian, aproveitando o tуpico, me tire outra duvida ... como eu tiro o Respawn dos carros automaticamente ? tipo sabe-se que o ultimo numero do staticvehicle й o do respawn ... como tiro o respawn ?


Re: [AJUDA]Restringindo carros. - WLSF - 03.10.2011

Pelo oque eu sei AddStatiVehicle nгo tem respawn, apenas o (Ex) tem respawn...
se vocк mudar o seu AddStaticVehicleEx - para AddStaticVehicle - talvez dк certo. (:


Re: [AJUDA]Restringindo carros. - nefestor - 03.10.2011

й verdade ... os meus sгo addstaticvehicleEx... eu troco pra addstaticvehicle e tiro o ultimo numero ? que no caso seria o respawn ? ou mantenho o mesmo ?