Jump to content

some Help in Trigger event :)


^Dev-PoinT^

Recommended Posts

Hi i have problem with Trigring see

client

triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(),)  

server

addEvent ( "onPlayerChooseTeam" , true ) 
addEventHandler ( "onPlayerChooseTeam" , root , 
function ( teamName ) 
local team = getTeamFromName ( teamName ) 
setPlayerTeam ( source , team ) 
outputChatBox("You have successfully choosed "..getTeamName(team).." team.", resPlayer, root, 255, 255, 0) 
end ) 

Link to comment
triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(),)  

should be

triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(),teamName)  

------------------------------------------------

outputChatBox("You have successfully choosed "..getTeamName(team).." team.", resPlayer, root, 255, 255, 0) 

should be

outputChatBox("You have successfully choosed "..getTeamName(team).." team.", source, 255, 255, 0) 

Link to comment
function me () 
if (source ~= getLocalPlayer()) then return end 
    local team = getPlayerTeam ( source ) 
    if ( team ) then 
    local teamName = getTeamName(team) 
    triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(),teamName) 
    end 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), me ) 

Link to comment

what?

LOL!

LOL!

LOL!

LOL!

LOL!

LOL!

LOL!

LOL!

i think you don't know how to test your script

LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!

also i don't see a point to trigger to server

just this client Side

function me () 
if (source ~= getLocalPlayer()) then return end 
    local team = getPlayerTeam ( source ) 
    if ( team ) then 
    outputChatBox("You have successfully choosed "..getTeamName(team).." team.", 255, 255, 0) 
    end 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), me ) 

and Done

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...