SA-MP Forums Archive
Anti-Team Jack - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti-Team Jack (/showthread.php?tid=201361)



Anti-Team Jack - Sledge - 21.12.2010

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?


Respuesta: Anti-Team Jack - admantis - 21.12.2010

OnPlayerEnterVehicle

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


Re: Respuesta: Anti-Team Jack - Sledge - 21.12.2010

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.


Re: Anti-Team Jack - Leeroy. - 21.12.2010

Use OnPlayerStateChange()