Jump to content

Any Proplem


AmOt,7bk

Recommended Posts

addEventHandler ( "onClientGUIClick", resourceRoot, function( ) 
if ( source == GUIEditor.button[3]) then 
triggerServerEvent ( "SetPTeam", localPlayer ) 
end 
end ) 
  
-- 
  
Server 
  
local team = createTeam( "team1", 0, 255, 0 ) 
  
addEvent( "SetPTeam", true ) 
addEventHandler( "SetPTeam", root, function( ) 
setPlayerTeam( client, team ) 
giveWeapon( client, 31, 500 ) 
outputChatBox(''You Now Take Job Killer '',client ) 
end ) 
addEventHandler ( "onClientPlayerDamage", localPlayer, function( attacker ) 
if ( attacker and attacker ~= source ) then 
if ( getPlayerTeam( attacker ) and getPlayerTeam( attacker ) == getTeamFromName( "TeamName" ) ) then 
if ( getPlayerTeam( source ) ) then 
setElementPosition( source, x, y, z ) 
end 
end 
end 
end ) 

Link to comment
  • Moderators
Replace client with source.

No. Learn more about events here: https://wiki.multitheftauto.com/wiki/Event

@Amot: You used single quotes quotes instead a double quotes (it's not the same, see the syntax highlighting)

outputChatBox("You Now Take Job Killer", client )

It was working, it's just you couldn't see it.

if player wasted spwan player x y z

Why did you use onClientPlayerDamage instead of onPlayerWasted ??

Client:

Use the same code you did

Server:

local team1 = createTeam( "team1", 0, 255, 0 ) 
  
addEvent( "SetPTeam", true ) 
addEventHandler( "SetPTeam", root, 
    function( ) 
        setPlayerTeam( client, team1 ) 
        giveWeapon( client, 31, 500 ) 
        outputChatBox("You Now Take Job Killer", client) 
    end 
) 
  
addEventHandler ( "onPlayerWasted", root, 
    function( attacker ) 
        if getPlayerTeam( source ) == getTeamFromName( "team1" )then 
            local x, y, z = 10, 15, 2 --change or remove if defined somewhere else 
            spawnPlayer( source, x, y, z, 0, getElementModel(source)) 
        end 
    end 
) 

And stop spamming, as said Bonsai or you will effectively get banned.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...