Jump to content

MTA SCRIPTING HELP PLEASE =D


Recommended Posts

Well i know i posted a couple of threads now but yestarday i finally created a working script =D (( ' :arrow: Never give up :arrowleft: ' )). Well i really wanted to move off the basic stuff and learn how to connect client-side and server-side together so all GUI things are on client-side and when the button is clicked it is on server-side any help or functions pleasee !!! =D

Link to comment

Example:

This the client side:

addEventHandle("onClientGUIClick", root, 
function() 
    if source == YourButtonHere then 
        triggerServerEvent("AnyNameToTheEvent", localPlayer, "Hello!", "ZzZzZz") 
    end 
end) 

And this the server side:

addEvent("AnyNameToTheEvent", true) 
addEventHandler("AnyNameToTheEvent", root, 
function(arg1, arg2) 
    outputChatBox(getPlayerName(source).." has clicked the button and say "..arg1.." and say "..arg2) 
end) 

Try it.

Link to comment
Example:

This the client side:

addEventHandle("onClientGUIClick", root, 
function() 
    if source == YourButtonHere then 
        triggerServerEvent("AnyNameToTheEvent", localPlayer, "Hello!", "ZzZzZz") 
    end 
end) 

And this the server side:

addEvent("AnyNameToTheEvent", true) 
addEventHandler("AnyNameToTheEvent", root, 
function(arg1, arg2) 
    outputChatBox(getPlayerName(source).." has clicked the button and say "..arg1.." and say "..arg2) 
end) 

Try it.

Error , addEventHandle> addEventHandler

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