[AJUDA]blokiar arma
#1

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!
Reply
#2

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;
}
Reply
#3

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

case 16,35: {

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

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

Aqui deu : }
Reply
#7

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;
}
Reply
#8

aff bota no fim do gm certo?
Reply
#9

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("-----------------------------");
Reply
#10

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

Ricop nгo seria SetPlayerAmmo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)