MIKI785 Posted July 11, 2012 Share Posted July 11, 2012 Hello, I have problems with events... there are no errors or warning in the scripts but when I try to call client event "onPlayerWinTheRace" from server, it shows error that it;s not added client side. But i have this in client script: addEvent("onPlayerWinTheRace",true) addEventHandler("onPlayerWinTheRace",getRootElement(),function) So, where is the problem? Other events don't work as well in this script... from server > client. The server side is this: triggerClientEvent(getRootElement(), "onPlayerWinTheRace", player, player) Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 triggerClientEvent(getRootElement(), "onPlayerWinTheRace", player, player) Why you need send two times 1 player? function yourFunctionHere ( thePlayer,doublePlayer ) --Your code Here end addEvent( "onPlayerWinTheRace", true ) addEventHandler( "onPlayerWinTheRace", getRootElement(), yourFunctionHere ) Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 What did you change there? O_o I send it twice, because the first one is source, and i don't use source, but first argument in the function. Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 What did you change there? O_oI send it twice, because the first one is source, and i don't use source, but first argument in the function. try my code you call trigger for ALL and send to client double players example player = MIKI785 so in client code will outputChatBox ('guy '..getPlayerName(thePlayer)..' copy '..getPlayerName(doublePlayer),getRootElement(),255,255,255,true) Will guy MIKI785 copy MIKI785 why you need it? Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 What? It still says that the event is not added client side... Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 What? It still says that the event is not added client side... it's working try triggerClientEvent("onPlayerWinTheRace", getRootElement(), player) Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 Still.. the event is not added client side. Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 Still.. the event is not added client side. show your all code, it's working on my server... Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 I tested it on my local server and it worked, then I added it on public server and it doesn't work... Client: function showTheWinMessage(thePlayer) --Code which is working.. end addEvent( "onPlayerWinTheRace", true ) addEventHandler( "onPlayerWinTheRace", getRootElement(), showTheWinMessage ) Server: function playerWinTheRace(player) --This is called by the race.. triggerClientEvent("onPlayerWinTheRace", getRootElement(), player) end Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 did you refresh the script on publick server? and wait you trigger event from race to other resource? Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 No, it's exported function, at it is called... Yes, I refreshed it, i'm not that stupid... Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 No, it's exported function, at it is called...Yes, I refreshed it, i'm not that stupid... man code is working you're doing something wrong,you need restart resource on the publick server search your error Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 OMG, I did it like 20 times? It still says that the event is not added client side, there are no other errors or anything,... Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 OMG, I did it like 20 times? It still says that the event is not added client side, there are no other errors or anything,... LoL, The same code works on my local server... WTF?! Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 are you kidding me? search your error Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 There is no error if the same code works on my local server without problems... Link to comment
TwiX! Posted July 11, 2012 Share Posted July 11, 2012 man code is working you're doing something wrong search your error Your error not in the CODE.. Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 Then where is it? This script works on my local server but it doesn't work on my public server.................... Link to comment
MIKI785 Posted July 11, 2012 Author Share Posted July 11, 2012 It works now... The problem was in the protected argument in meta... it works on windows server, on linux server, the script won't work O_o. 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