1. 22-06-2020, 03:07
    #1

    Junior of PTP
    1,219 • 8,061 • 29
    In-game: =TKN=
    You cant damage teammate vehicles in PTP, so many players got punished for abusing this by teaming with other team players.
    This client-side script forces player to exit vehicle if vehicle driver is an opposing team player.



    Code:
    antiTeamingMatrix = { -- player's team (left side), driver's team (right side, after = )
    	["Terrorists"] = {["President"] = true, ["Secret Service"] = true, ["Police"] = true},
    	["Police"] = {["Terrorists"] = true},
    	["Secret Service"] = {["Terrorists"] = true},
    	["President"] = {["Terrorists"] = true},
    	["Medics"] = {["President"] = true, ["Police"] = true, ["Secret Service"] = true, ["Terrorists"] = true, ["Civilians"] = true}
    }
    
    function antiTeaming()
        -- check if player is inside a vehicle --
        vehicle = getPedOccupiedVehicle(localPlayer)
        if not vehicle then return end
            -- if player is passenger / not driver --
            if getPedOccupiedVehicleSeat(localPlayer) ~= 0 then 
            driver = getVehicleController(vehicle)
            sourceTeam = getPlayerTeam(localPlayer)
            -- if there is a driver --
            if driver then
            driverTeam = getPlayerTeam(driver)
            -- check if driver is an opposing team player --
            if antiTeamingMatrix[getTeamName(sourceTeam)][getTeamName(driverTeam)] then 
                -- force player to exit the vehicle --
                setPedControlState(localPlayer, "enter_exit", true)
                setTimer( function()
                    setPedControlState(localPlayer, "enter_exit", false)
                end, 50, 1)
                -- show warning text to player --
                if isTimer(warningTexts) == false then
                addEventHandler("onClientRender", root, showInfo)
                -- stop showing warning text after 3 sec ---
                warningTexts = setTimer( function()
                    removeEventHandler("onClientRender", root, showInfo)
                end, 3000, 1)
                end
            end
            end
        end
    end
    -- repeat these checks every 3 sec --
    setTimer(antiTeaming, 3000, 0)
    
    function showInfo()
        local screenWidth, screenHeight = guiGetScreenSize()
        dxDrawText(("TEAMING IS NOT ALLOWED!"), screenWidth/3.764705882352941+7, screenHeight/1.7, screenWidth/1.361702127659574, screenHeight/1.28, tocolor(0, 0, 0, 90), 3.5, 3.5, "default-bold", "center", "center")
        dxDrawText(("TEAMING IS NOT ALLOWED!"), screenWidth/3.764705882352941, screenHeight/1.7, screenWidth/1.361702127659574, screenHeight/1.28, tocolor(255, 69, 69), 3.5, 3.5, "default-bold", "center", "center")
    end
    You can use this script on your maps, just copy paste this file into your map folder and edit meta.xml
    https://www.mediafire.com/file/ro3fq...aming.lua/file

    Meta.xml: <script src="antiTeaming.lua" type="client"></script>


  2. 22-06-2020, 12:08
    Junior Member
    60 • 176 • 3
    In-game: "Nobume*
    Re: [PTP] Anti_Teaming Script | Release 22-06-2020, 12:08 • #2
    Will this script take effect on the Civilians Team? I mean civilians may team on which side they want. So will this script disable that?


    1 Like


  3. 22-06-2020, 16:10
    Junior of PTP
    1,219 • 8,061 • 29
    In-game: =TKN=
    Re: [PTP] Anti_Teaming Script | Release 22-06-2020, 16:10 • #3
    Originally Posted by Logic32
    Will this script take effect on the Civilians Team? I mean civilians may team on which side they want. So will this script disable that?
    Nope, Civilians are allowed to help both sides so this script will not work on Civilians.
    1 Like


  4. 22-06-2020, 16:24
    Junior Member
    32 • 28 • 2
    In-game: DkAeon^! Online
    Re: [PTP] Anti_Teaming Script | Release 22-06-2020, 16:24 • #4
    awesome script thx tkn <3
    1 Like
    TKN 

1 Users reading this thread (0 Members and 1 Guests)