SA-MP Forums Archive
[Ajuda] Proibir Arma no interior - 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] Proibir Arma no interior (/showthread.php?tid=301465)



[Ajuda] Proibir Arma no interior - Leo_Lost - 04.12.2011

Queria saber como faзo para proibir alguem de usar a Weapon id [35] nos interiores, se alguem souber me da uma dica ae.


Re: [Ajuda] Proibir Arma no interior - rjjj - 04.12.2011

Isto deve resolver o seu problema .


Coloque :


pawn Код:
//Na sua public OnPlayerUpdate:

if(GetPlayerInterior(playerid))
    {
        if(GetPlayerWeapon(playerid) == 35)
        {
            SetPlayerAmmo(playerid, 35, 0);
            SendClientMessage(playerid, 0x33CCFFAA, "Vocк nгo pode usar Bazooka em Interiores !");
        }
    }


Ou crie um Timer que fique fazendo, em um tempo determinado, a verificaзгo acima .



Espero ter ajudado .


Re: [Ajuda] Proibir Arma no interior - ViniBorn - 04.12.2011

Isso pode te ajudar.

https://sampforum.blast.hk/showthread.php?tid=277245


Re: [Ajuda] Proibir Arma no interior - CyNiC - 04.12.2011

Basta colocar isso em seu gamemode/filterscript:

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(oldinteriorid == 0)
    {
        for(new i = 0, w[2]; i < 13; i++)
        {
            GetPlayerWeaponData(playerid, i, w[0], w[1]);

            if(w[0] == 35)
            {
                GivePlayerWeapon(playerid, 35, -w[1] * 2);
            }
        }
    }
    else if(newinteriorid == 0)
    {
        for(new i = 0, w[2]; i < 13; i++)
        {
            GetPlayerWeaponData(playerid, i, w[0], w[1]);

            if(w[0] == 35)
            {
                GivePlayerWeapon(playerid, 35, -(w[1] * 2));
            }
        }
    }
    return 1;
}



Re: [Ajuda] Proibir Arma no interior - Leo_Lost - 04.12.2011

Vlw vo usar uma timmer.