Jump to content

Bebras

Members
  • Posts

    8
  • Joined

  • Last visited

Bebras's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. It does output: "should be triggered"
  2. I'm sorry, what is wrong with it? Because you just described what i want it to do
  3. No errors, but still it is not printed
  4. Tried it, got this error: attempt to call global 'getLocalPlayer' Off-topic: what is "nil" is it like null?
  5. If you meant here: addEventHandler("onRegister",getLocalPlayer(),registerHandler) , then it didn't help
  6. Hello, so my topic name is not very informative as i don't really know where the problem is... Anyway, this is my server-side code: function checkPlayer(playerNick) local result = mysql_query(handler,"SELECT * FROM users WHERE Name = '"..playerNick.."'") if( not result) then outputDebugString("MySQL Fail ("..mysql_errno(handler)..") Error:"..mysql_error(handler)) end if(mysql_num_rows(result) == 0) then triggerClientEvent("onRegister",getRootElement()) outputDebugString("Should be triggered") else row = mysql_fetch_row(result) end mysql_free_result(result) end addEventHandler("onPlayerConnect",getRootElement(),checkPlayer) and this is my client-side code: function registerHandler() outputDebugString("Function for registering is called") end addEvent("onRegister",true) addEventHandler("onRegister",getRootElement(),registerHandler) And the string "function for registering is called" isn't printed out.. I did it exactly like in the wiki, and yet i failed somehow... where is the problem?
  7. Great, thanks ! Why did you change it to "getLocalPlayer"? Isn't it predefined and asigned to variable "localPlayer" And just because i have an open topic: a command that spawns a vehicle should be server-sided right? For the vehicle to be synced?
  8. Okay, i'm a complete beginner(like this is my 2nd command code..), and i was trying to create a client-side command with the code: function displayPosition() local x,y,z = getEelementPosition(localPlayer); outputChatbox("X:"..x.."Y:"..y.."Z:"..z,0,255,0); end addCommandHandler("pos",displayPosition); I added this line to my meta file: <script src="clientCommand.lua" type="client" /> What is wrong, because it doesn't work? Again, i'm a beginner and any feedback will be appreciated
×
×
  • Create New...