Anti-Team Jack
#1

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(vehicleid == GetPlayerVehicleID(i))
        {
            if(IsPlayerInVehicle(i, vehicle))
            {
                if(Team[i] == Team[playerid])
                {
                    new Float:slx, Float:sly, Float:slz;
                    GetPlayerPos(playerid, slx, sly, slz);
                    SetPlayerPos(playerid, slx, sly, slz+2);
                    SendClientMessage(playerid, COLOR_ERROR, "ERROR: You can not team jack!");
                    RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
The code above is my anti team jack. Would it work?
Reply
#2

OnPlayerEnterVehicle

(it detects when player press enter to enter a vehicle not when your in it already)
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
OnPlayerEnterVehicle

(it detects when player press enter to enter a vehicle not when your in it already)
Yes, I know that. That's why it sets your position up 2 in the Z axis. The "RemovePlayerFromVehicle" is just there in case something does go wrong.
Reply
#4

Use OnPlayerStateChange()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)