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



[AJUDA]blokiar arma - Luiiz - 19.04.2012

tem algum geito de bloquiar certas armas dentro de interior tipo o cara tentava usar uma bazuca dentro do interior da pref ae aparecia "voce nao pode usar esta arma em interiores" alguem me aju? +REP!


Re: [AJUDA]blokiar arma - zbt - 19.04.2012

Bloquear todas
pawn Код:
public OnGameModeInit() {
    SetTimer("Armas", 1000, true);
    return true;
}

forward Armas();
public Armas() {
    for(new i, j = MAX_PLAYERS; i != j; ++i) {
        if(GetPlayerInterior(i) != 0) {
            if(GetPlayerWeapon(i) > 1) {
                GivePlayerWeapon(i, 1, 1);
            }
        }
    }
    return true;
}
Algumas
pawn Код:
forward Armas();
public Armas() {
    for(new i, j = MAX_PLAYERS; i != j; ++i) {
        if(GetPlayerInterior(i) != 0) {
            switch(GetPlayerWeapon(i)) {
                case /*id armas*/: {
                    GivePlayerWeapon(i, 1, 1);
                }
            }
        }
    }
    return true;
}



Re: [AJUDA]blokiar arma - Luiiz - 19.04.2012

bota no case pra mim rs? id das armas 16 e 35


Re: [AJUDA]blokiar arma - zbt - 19.04.2012

case 16,35: {

Caso ele tenha uma dessas armas , serб setado o punho , impedindo ele de atirar.


Re: [AJUDA]blokiar arma - Luiiz - 19.04.2012

ae mano nem deu fiko normal aida da pra usar as armas em interior


Re: [AJUDA]blokiar arma - zbt - 19.04.2012

Aqui deu : }


Re: [AJUDA]blokiar arma - Ricop522 - 19.04.2012

pawn Код:
#define RemovePlayerWeapon(%0, %1) GivePlayerAmmo(%1, 0)

public OnGameModeInit() {
    SetTimer("Armas", 1000, true);
    return true;
}
forward Armas();
public Armas() {
    for(new i, j = GetMaxPlayers(); i != j; i++) {
        if(GetPlayerInterior(i) != 0) {
            switch(GetPlayerWeapon(i)) {
                case 22,23,24,25,26,27,28,29,30,31,32,33,34,35,36: { / assim por diante..
                    RemovePlayerWeapon(i, GetPlayerWeapon(i));
                }
            }
        }
    }
    return 1;
}



Re: [AJUDA]blokiar arma - Luiiz - 19.04.2012

aff bota no fim do gm certo?


Re: [AJUDA]blokiar arma - Luiiz - 19.04.2012

tadando erro no OnGameModeInit como bota essa bosta lб?

pawn Код:
public OnGameModeInit()
{
    CarregarMods();
    getdate(v[0], v[1], v[2]);
    gettime(v[3], v[4], v[5]);
    print("\n---------------------------------------------------------");
    printf("Server Ligado: [%02d/%02d/%d %02d:%02d:%02d]", v[2], v[1], v[0], v[3], v[4], v[5]);
    print("---------------------------------------------------------\n");
//  synctimer = SetTimer("SyncUp", 60000, 1);
    /*minhafuncao("uvcqa");
    minhafuncao("uvkqa");*/

    EnableStuntBonusForAll(0);
    SetHora();
    print("-----------------------------");
    print("*** GM - Iniciado ***");
    print("-----------------------------");



Re: [AJUDA]blokiar arma - zbt - 19.04.2012

Nossa vйi, sу botar SetTimer("Armas", 1000, true); no ongamemodeinit e a public no final -'

Ricop nгo seria SetPlayerAmmo?