Anti Team Hijack help
#1

i use pteam
how do i script anti team hijack.
after 3 team hijacks the server will kick player
~May u help me
Reply
#2

I'm sorry but what exactly you mean by this? You mean when a team mate will jack you out of car?

pawn Код:
new CarJack[MAX_PLAYERS];

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger) SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
    else
    {
        new vehid_2 = -1, Float:Pos[3];
        foreach(Player, i)
        {
            vehid_2 = GetPlayerVehicleID(i);
            if(GetPlayerState(i) == PLAYER_STATE_DRIVER && vehicleid == vehid_2 && pTeam[playerid] == pTeam[i])
            {
                SetVehicleParamsForPlayer(vehicleid, playerid, 0, 1);
                GetPlayerPos(playerid, Pos[0], Pos[1],     Pos[2]);
                SetPlayerPos(playerid, Pos[0], Pos[1]+1.5, Pos[2]);    
                ClearAnimations(playerid);
                SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
                CarJack[playerid]++;
                if(CarJack[playerid] == 3)
                {
                    Kick(playerid);
                    // Send Message
                }
                break;
            }
        }
    }
    return 1;
}
Reply
#3

yes so it will exit him and give him warning
Reply
#4

Check ur pm
Btw anyone can help me script a few things scriptor position promised
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)