Jump to content

Clienttrigger & gui


Rutex

Recommended Posts

hi all. I have an problem. Im new in this lua framework, and i have issues with triggers.

i have no problems to send from client to server, but from server to client - its an a problem.

I have on server side check code. this code will send on client trigger.like so.

server:

if (UserCreated == false) then 
// some code ... 
clientTriggerEvent("LoginType",resourceRoot, "register") 
elseif(UserCreated == true) then 
//some code ... 
clientTriggerEvent("LoginType",resourceRoot, "login") 

client:

function guiA(Type) 
if (Type == "register") then 
//some code  
elseif (Type == "login") then 
//some code 
end 
addEvent("LoginType",true) 
addEventHandler( "LoginType", localPlayer, guiA) 

So now. The problem is - if connect player to the server, on side server - all fine. But client can not show gui. i think its wrong with triggers. also In log files - no errors or warnigs.

Yes. I know. i can use ofc the register of MTA, but i want to understand my error and the mta mehanics, to the future scripting.

p.s. sorry for my bad english :D

Link to comment

A quick look at the wiki could have fixed your problem.

  
    if (UserCreated == false) then 
    // some code ... 
    triggerClientEvent("LoginType",resourceRoot, "register") 
    elseif(UserCreated == true) then 
    //some code ... 
    triggerClientEvent("LoginType",resourceRoot, "login") 
  

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