[FilterScript] Detectar Car mass spawn!
#10

Quote:
Originally Posted by RoacH`
Посмотреть сообщение
Atualizado novamente! agora estб bem preciso, player й banido em millesseconds.. atй mais rapido do que o do Drakins -q
Quero meus crйditos por ter usado minha lуgica de uma chamada adicional em OnState

Ediзгo:
Como vocк nгo usou OnPlayerStateChange isto irб dar errado. Isto й, vai banir todos jogadores que trocarem de carro

Vocк tem que checar se o cara TROCOU DE CARRO e o STATE CHANGE nгo foi chamado (registerOnState). Foi isto que eu fiz.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if((newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) && oldstate != PLAYER_STATE_SPECTATING) {
        if((gettime() - GetPVarInt(playerid, "EnterVehicle")) < 2) {

            // antes de banir. Cheque se o jogador nгo usou algo com PutPlayerInVehicle em seu servidor (tipo flood de /criarcarros).

            SendClientMessage(playerid, -1, "[Info] Banido por usar spawnerr mass");
            BanEx(playerid, "CLEO 4");
        }
        SetPVarInt(playerid, "registerOnState", 1);
        SetPVarInt(playerid, "EnterVehicle", gettime());
    }
    return true;
}

public OnPlayerUpdate(playerid) {

    static
        varVeh
    ;
    if((varVeh = GetPlayerVehicleID(playerid))) {

        if(varVeh != GetPVarInt(playerid, "prevVeh")) {

            if(!GetPVarInt(playerid, #registerOnState)) {
                OnPlayerStateChange(playerid, PLAYER_STATE_DRIVER, INVALID_PLAYER_ID);
            }

            SetPVarInt(playerid, #registerOnState, 0);
            SetPVarInt(playerid,"prevVeh", varVeh);
        }
    }
    return true;
}
Reply


Messages In This Thread
Detectar Car mass spawn! - by RoacH` - 20.06.2012, 00:15
Re: Detectar Car mass spawn! - by Edu33 - 20.06.2012, 00:17
Re: Detectar Car mass spawn! - by Hiuship - 20.06.2012, 00:21
Re: Detectar Car mass spawn! - by ipsBruno - 20.06.2012, 00:45
Re: Detectar Car mass spawn! - by ipsBruno - 20.06.2012, 01:05
Re: Detectar Car mass spawn! - by Juninho_Oakley - 20.06.2012, 01:24
Re: Detectar Car mass spawn! - by RoacH` - 20.06.2012, 01:44
Re: Detectar Car mass spawn! - by ipsBruno - 20.06.2012, 01:53
Re: Detectar Car mass spawn! - by RoacH` - 20.06.2012, 16:58
Re: Detectar Car mass spawn! - by ipsBruno - 20.06.2012, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)