SA-MP Forums Archive
[Pedido] Proibir certas armas em Interiores! - 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: [Pedido] Proibir certas armas em Interiores! (/showthread.php?tid=443346)



[Pedido] Proibir certas armas em Interiores! - Faayad - 11.06.2013

Eae galera,eu to querendo saber como eu faзo pra proibir certas armas em interiores,por exemplo: Bazuca e Lanзa chamas,caso o jogador estiver com a arma na mгo,reseta a a arma dele,e enviasse uma mensagem a ele dizendo que nгo pode usar esse tipo de armas em interiores!,queria uma ajuda de vocкs,quem pфde ajudar eu ae estarei muito agradecido ! Vlw (:


Respuesta: [Pedido] Proibir certas armas em Interiores! - Wendell - 11.06.2013

PHP код:
forward CheckExplo(playerid);//Topo do GM
SetTimer("CheckExplo"7001);//Na Public OnGameModeInit
public CheckExplo(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
GetPlayerInterior(i) > 0)
        {
            if(
GetPlayerWeapon(i) == 16 || GetPlayerWeapon(i) == 18 || GetPlayerWeapon(i) == 34 || GetPlayerWeapon(i) == 35)//Й sу substituir pelos ids das armas que quer proibir .
            
{
                
SetPlayerArmedWeapon(i0);
                                
SendClientMessage(playerid, -1"Vocк nгo pode usar esse tipo de arma em Interior");
            }
        }
    }




Re: [Pedido] Proibir certas armas em Interiores! - smiiir - 11.06.2013

PHP код:
forward ChecarArma playerid ) ; public ChecarArma playerid )
{
    for ( new 
0<= MAX_PLAYERSe++)
    {
        if ( 
GetPlayerInterior ) > )
        {
            if ( 
GetPlayerWeapon ) == 16 || GetPlayerWeapon ) == 35 || GetPlayerWeapon ) == 38 // Granada, Bazuuca, Minigun
            
{
                
SendClientMessage i, -1"Arma proibida use fora do interior" ) ;
                
SetPlayerArmedWeapon i) ;
            }
        }
    }
}
// OnGameModeInit
SetTimer("ChecarArma"10001) ; 



Re: [Pedido] Proibir certas armas em Interiores! - Faayad - 11.06.2013

Os 2 funfaram certinho,Obrigadгo aos 2 que me ajudarгo!