villr Posted July 21, 2012 Posted July 21, 2012 Hello everyone.. again, now my problem is that i want to trigger from my gui when u click an button, so it looks up to serverside if an player already rent an boat and then if they already did it, nothing should happend. I already got an code but idk how to fix the triggers to fit the gui code Any tips? Client elseif (source == rentbutton) then triggerServerEvent("gotBoatRented", getLocalPlayer()) function gotBoatRented(state) outputChatBox (state) return state end addEvent("gotBoatRented", true) addEventHandler("gotBoatRented", getRootElement(),gotBoatRented) -- Server addEvent("gotBoatRented", true) addEventHandler("gotBoatRented", getRootElement(), function () state = false for k,v in ipairs(reefers) do local rentowner = getElementData(v,"rentowner") if rentowner == getAccountName(getPlayerAccount(source)) then state = true outputChatBox ("true") end end outputChatBox(state) triggerClientEvent ( source, "gotBoatRented", getRootElement(), state ) end ) This is what i started on but idk how to make it work.. Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Jaysds1 Posted July 22, 2012 Posted July 22, 2012 Sorry, I'm confused here, you got events and one looks like it's client-sided and the other looks like it's server-sided. Can you post the codes in a whole lua block( ). ad this script isn't good enough, PM me if your want help from there. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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