20.06.2012, 18:18
Quote:
Atualizado novamente! agora estб bem preciso, player й banido em millesseconds.. atй mais rapido do que o do Drakins -q
|

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;
}