Jump to content

triggerClientEvent


BrianNZ

Recommended Posts

this is were it starts(toggles the window that the info is displayed in.

Client

function guiToggleVisibleCharSheet ( ) 
        --guiSetText(nameLabel, "Name: " .. guiGetText ( name )) 
        --guiSetText(ageLabel, "Age: " .. guiGetText ( age )) 
        outputDebugString ( "PlayerJoin" ) 
        triggerServerEvent ( "SendMyInfo", getLocalPlayer() ) 
        guiSetText(genderLabel, "Sex: " .. guiGetText ( gender )) 
        if ( guiGetVisible ( charSheet ) == true ) then  
                guiSetVisible ( charSheet, false )  
        else              
                guiSetVisible ( charSheet, true )  
        end 
end 

Then it calls this(the info has been removed or "commented" while i was trying to find the problem.)

Server

function SendMyInfo ( ) 
    outputDebugString ( "send my info" ) 
    --triggerClientEvent ( source, "something", getRootElement(), players[getID(source)].name, players[getID(source)].age, players[getID(source)].serisl ) 
    --triggerClientEvent ( source, "something", getRootElement()) 
    triggerClientEvent (  "updateStats", source, getRootElement()) 
    --, "boo", "boo1", "ggg"  
end 
  
addEvent ( "SendMyInfo" , true )     
addEventHandler ( "SendMyInfo", root, SendMyInfo ) 

Then, it "should" trigger the next thing. but it doesn't seem to.)

Client

function updateStats ( ) 
 --newb1, newb2,newb3 
    outputChatBox ( "got my info") 
    --guiSetText(nameLabel, "Name: " .. newb1 .. newb3) 
    --guiSetText(ageLabel, "Age: " .. newb2) 
end 
  
addEvent ( "updateStats" , true )    
addEventHandler ( "updateStats", root, updateStats ) 

Any ideas whats ahppening?

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