Best-Killer Posted November 2, 2016 Share Posted November 2, 2016 (edited) function citycheck (plr) if ( plr and plr ~= source and getElementType(plr) == "player" ) then local city = getElementZoneName(plr,true) if city == "Las Venturas" then triggerClientEvent ( plr, 'killslist', plr ) end end end No error but the gui didn't open ? what i want do ?? that when player be in Lv that gui showed to the player Edited November 2, 2016 by Best-Killer Link to comment
LoPollo Posted November 2, 2016 Share Posted November 2, 2016 If there are no errors clientside as you said, i would check if the function gets really called (both this and the client side handler), and if the function gets called try checking all variables or excluding them (ie append to the if statement an "or true") if that won't cause problems. This may be not helpful, i'm not expert, but till others reply to this you can try what i said Link to comment
Best-Killer Posted November 2, 2016 Author Share Posted November 2, 2016 everything is fine but gui not opened Link to comment
iPrestege Posted November 2, 2016 Share Posted November 2, 2016 is the plr defined? how is the source? show us the client part. Link to comment
Best-Killer Posted November 2, 2016 Author Share Posted November 2, 2016 addEvent( 'killslist', true ) addEventHandler ( 'killslist', function() guiSetVisible ( killgrid,true ) triggerServerEvent( 'getData', localPlayer ) end ) Link to comment
iPrestege Posted November 2, 2016 Share Posted November 2, 2016 (edited) how do you handle ' citycheck ' function? you send a traigger from the client or there's an event in the server or how? and you didn't answer my questions how is the plr is it defined also what's the source. Edited November 2, 2016 by FaHaD Link to comment
LoPollo Posted November 2, 2016 Share Posted November 2, 2016 (edited) shouldn't addEventHandler be attached to something? i guess localPlayer but not sure Edited November 2, 2016 by LoPollo bad english Link to comment
iPrestege Posted November 2, 2016 Share Posted November 2, 2016 1 minute ago, LoPollo said: shouldn't addEventHandler be attached to something? i guess localPlayer but not sure That's true LoPollo's find where is the problem i guess as he said you are missing the event attached to so just use 'root'. Also i'm pretty sure there's an error for that in the client side? there's not? Link to comment
LoPollo Posted November 2, 2016 Share Posted November 2, 2016 For sure there's an error, so @Best-Killer must have checked the console/server log, while there's a file where you can see the errors in client-side, check: MTA San Andreas 1.5\MTA\logs\clientscript.log Also tell us if the script works when you can Link to comment
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