AmOt,7bk Posted February 25, 2014 Share Posted February 25, 2014 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
Bonsai Posted February 25, 2014 Share Posted February 25, 2014 You expect us to just post a solution while you don't even describe the problem? Replace client with source. Link to comment
AmOt,7bk Posted February 25, 2014 Author Share Posted February 25, 2014 code doesn't work this job serial killer if start job set player team if player wasted spwan player x y z Link to comment
Bonsai Posted February 25, 2014 Share Posted February 25, 2014 If you continue spamming you will get banned. Link to comment
pa3ck Posted February 25, 2014 Share Posted February 25, 2014 outputChatBox("You Now Take Job Killer",client ) Link to comment
Moderators Citizen Posted February 25, 2014 Moderators Share Posted February 25, 2014 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
Bonsai Posted February 25, 2014 Share Posted February 25, 2014 Replace client with source. No. Learn more about events here: https://wiki.multitheftauto.com/wiki/Event Oh, didn't know that. I'm used to work with source only. Thanks. Link to comment
Moderators Citizen Posted February 25, 2014 Moderators Share Posted February 25, 2014 Client ?? Did you really read my post ?? Client:Use the same code you did Link to comment
AmOt,7bk Posted February 25, 2014 Author Share Posted February 25, 2014 Oh Thanx You Best Scripter Anything Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now