Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- static ZZ_Timer;
- #define IP_F 1000
- enum nn
- {
- ip[14],
- adv
- }
- new ZZInfo[IP_F][nn];
- forward ZZ_cTroll();
- forward EsTroll(playerid);
- public OnFilterScriptInit()
- {
- ZZ_Timer = SetTimer("ZZ_cTroll", 1000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(ZZ_Timer);
- for (new i = 1; i < IP_F; i++)
- {
- ZZInfo[i][ip] = 0;
- ZZInfo[i][adv] = 0;
- }
- return 1;
- }
- public ZZ_cTroll()
- {
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerInAnyVehicle(i))
- {
- if(GetPlayerVehicleID(i) != GetPVarInt(i, "ZZ_Coche"))
- {
- if(gettime() > GetPVarInt(i, "ZZ_Tiempo"))
- {
- EsTroll(i);
- }
- }
- }
- }
- }
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(GetPVarInt(playerid, "ZZ_RJack") == 1)
- {
- EsTroll(playerid);
- }
- if(oldstate == PLAYER_STATE_PASSENGER)
- {
- EsTroll(playerid);
- }
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- SetPVarInt(playerid, "ZZ_Coche", vehicleid);
- if(!ispassenger)
- {
- SetPVarInt(playerid, "ZZ_RJack", 1);
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPVarInt(playerid, "ZZ_RJack") == 1 && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_ENTER_VEHICLE)
- {
- SetPVarInt(playerid, "ZZ_RJack", 0);
- SetPVarInt(playerid, "ZZ_Tiempo", gettime()+3);
- }
- return 1;
- }
- public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
- {
- if(floatround(floatsqroot(vel_x * vel_x + vel_y * vel_y) * 200, floatround_round) > 1100)
- {
- EsTroll(playerid);
- return 0;
- }
- if(GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z) > 15)
- {
- return 0;
- }
- return 1;
- }
- stock ZZ_PutPlayerInVehicle(playerid, vehicleid, seatid)
- {
- SetPVarInt(playerid, "ZZ_Tiempo", gettime()+3);
- SetPVarInt(playerid, "ZZ_Coche", vehicleid);
- SetPVarInt(playerid, "ZZ_RJack", 0);
- return PutPlayerInVehicle(playerid, vehicleid, seatid);
- }
- stock ZZ_RemovePlayerFromVehicle(playerid)
- {
- SetPVarInt(playerid, "ZZ_Tiempo", gettime()+3);
- SetPVarInt(playerid, "ZZ_Coche", 0);
- SetPVarInt(playerid, "ZZ_RJack", 0);
- return RemovePlayerFromVehicle(playerid);
- }
- public EsTroll(playerid)
- {
- new plrIP [ 16 ] ;
- GetPlayerIp ( playerid, plrIP, sizeof ( plrIP ) ) ;
- for (new i = 1; i < IP_F; i++)
- {
- if(ZZInfo[i][ip] == strval(plrIP))
- {
- if(ZZInfo[i][adv] == 3)
- {
- SendClientMessage(playerid, -1, "<<[ZZ_Anti-Troll]>> Baneado, límite de advertencias.");
- Ban(playerid);
- }else{
- ZZInfo[i][ip] = strval(plrIP);
- ZZInfo[i][adv]++;
- new string[150];
- format(string, 128, "<<[ZZ_Anti-Troll]>> Kickeado, no uses cheats o serás baneado. %d/3", ZZInfo[ip][adv]);
- SendClientMessage(playerid, -1, string);
- Kick(playerid);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement