Anti Car-Warping is not working as it should
#1

Deleted.
Reply
#2

Deleted.
Reply
#3

show me admin enum when player is admin or not ?
Reply
#4

Read the question well...it's not related to the enums.In fact,he's saying that it not even detecting the player warping.
Reply
#5

Quote:
Originally Posted by Sojo12
Посмотреть сообщение
Read the question well...it's not related to the enums.In fact,he's saying that it not even detecting the player warping.
Are you blinded? I asking becuase maybe set anti car wrapping if plaver is not admin and his state is drriver when he will kicked.
Reply
#6

Before it reachs to the admin thing whether he should be kicked /or not.First it should eb working right?
Reply
#7

no I mean that.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)

        if(newstate == PLAYER_STATE_DRIVER  && pAdmin[playerid] == 0)
        {
                  if((GetTickCount()-GetPVarInt(playerid, "CarTime")) < 1000)
                 {
                        SetPVarInt(playerid, "CarWarp", GetPVarInt(playerid, "CarWarp")+1);
                        if(GetPVarInt(playerid, "CarWarp") >= 5)
                       {
                            new pname[24];
                            new string[128];
                            GetPlayerName(playerid,pname,24);
                            format(string,sizeof(string),""COL_RED"%s(%d) has been kicked for car warping hack.",pname,playerid);
                            SendClientMessageToAll(-1,string);
                            printf(string);
                            Ban(playerid);
                         }
                }
                SetPVarInt(playerid, "CarTime", GetTickCount());
        }
        return 1;
}
Reply
#8

Deleted.
Reply
#9

This code looks better in my opinion. When player warps a vehicle OnPlayerEnterVehicle is not called. So put a variable which says that OnPlayerEnterVehicle is called.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SetPVarInt(playerid, "CurrentVehicle", vehicleid);
    return 1;
}
And when OPSC is called, check if player's current vehicle matches the variable we set in OPEV.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2 || newstate == 3)
    {
        if(GetPVarInt(playerid, "CurrentVehicle") != GetPlayerVehicleID(playerid))
        {
            Kick(playerid);
        }
    }
    return 1;
}
Sorry for my english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)