Jump to content

Anderl

Members
  • Posts

    2,266
  • Joined

  • Last visited

Everything posted by Anderl

  1. Create an event with createEvent and call the event: Call server event from client: triggerServerEvent Call client event from server: triggerClientEvent Call event from same side: triggerEvent You can also use functions from Wiki "callClientFunction" and "callServerFunction" or this: Client-side: local aReturnValue = { } addEvent( 'OnServerCallClientFunction', true ) addEvent( 'OnFunctionCallGetReturn', true ) addEventHandler( 'OnFunctionCallGetReturn', root, function( fn, returnValue ) aReturnValue[fn] = returnValue end ) addEventHandler( 'OnServerCallClientFunction', root, function( fn, ... ) if( #{ ... } ~= 0 ) then aReturnValue[fn] = _G[fn]( ... ) triggerServerEvent( 'OnFunctionCallGetReturn', root, fn, aReturnValue[fn] ) else aReturnValue[fn] = _G[fn]( ) triggerServerEvent( 'OnFunctionCallGetReturn', root, fn, aReturnValue[fn] ) end end ) function callServerFunction( fn, ... ) if( fn and type( fn ) == 'string' ) then if( #{ ... } ~= 0 ) then triggerServerEvent( 'OnClientCallServerFunction', root, fn, ... ) else triggerServerEvent( 'OnClientCallServerFunction', root, fn ) return aReturnValue[fn] or false end end Server-side: local aReturnValue = { } addEvent( 'OnClientCallServerFunction', true ) addEvent( 'OnFunctionCallGetReturn', true ) addEventHandler( 'OnFunctionCallGetReturn', root, function( fn, returnValue ) aReturnValue[fn] = returnValue end ) addEventHandler( 'OnClientCallServerFunction', root, function( fn, ... ) if( #{ ... } ~= 0 ) then aReturnValue[fn] = _G[fn]( ... ) triggerClientEvent( 'OnFunctionCallGetReturn', root, fn, aReturnValue[fn] ) else aReturnValue[fn] = _G[fn]( ) triggerClientEvent( 'OnFunctionCallGetReturn', root, fn, aReturnValue[fn] ) end end ) function callClientFunction( fn, ... ) if( fn and type( fn ) == 'string' ) then if( #{ ... } ~= 0 ) then triggerClientEvent( 'OnServerCallClientFunction', root, fn, ... ) else triggerClientEvent( 'OnServerCallClientFunction', root, fn ) return aReturnValue[fn] or false end end Not tested.
  2. Client side can't call server side functions. Same for events.
  3. You can use 3D Studio Max or ZModeler to create DFF ( if you mean that ) but you need some experience.
  4. local aZombieKills = { { 0, 4, "Text 1" }, { 5, 10, "Text 2" }; } for i = 1, #aZombieKills do if( zombiekills >= aZombieKills[i][1] and zombiekills <= aZombieKills[i][2] ) then -- show text: aZombieKills[i][3] break end end
  5. Would be better if you make a better UI and use buttons. It's not easy to use if these textbox doesn't have "comments", anyway good job.
  6. If I am not wrong: local oldData = executeSQLSelect( "RaceStats", "RaceLoses","serial = '" .. serial .. "'") Will just select "RaceLoses" not "RaceWins".
  7. I'm pretty sure it's a Game-Monitor problem. Lots of people are getting the same.
  8. As Sniper said, those functions are not available in MTA:SA.
  9. Buy a better VPS because yours sucks and/or install Debian/CentOS.
  10. Why? I don't see any problem with remote MySQL databases although I would not get a MySQL database from some unknown guy if you don't protect passwords( if you save them on that database ).
  11. Anderl

    Tables

    Oh, I just didn't understand this. I thought it should just run "createRandomLocation" when something would happen, you know, not when resource start. Dumbass head
  12. Anderl

    Tables

    Why "createRandomLocation ( )" in the end?
  13. I don't care if you can't think right. I'm just advising.
  14. Using HTML and MySQL would do the job. HTML/CSS/JS or even SWF for the design and MySQL to store data.
  15. function (_, gameOptions) if gameOptions.respawn then This should work.
  16. mapOptions is second parameter, not first.
  17. Its for me when i use my notebook I don't see what is the problem, I use laptop too and there's no problem with ALT+TAB.
  18. setTimer( spawnPlayer, timeInMsToWaitUntilSpawn, 1, player arguments> )
  19. What exactly does not work?
  20. Then maybe because it is not magic and it has only functions to be used to make your own scripts. Using scripts from community is really never a good way. Anyway, you could try to learn and make your scripts. There are ever people in the scripting section helping when you got problems or don't know something.
  21. I know this is dead but just wanted to say that I got some trial with them when they were online and it's bad. I can't say anything about lag but the owner was very immature and kid ( I know I am too but hell damn it ) and their website was really bad.
  22. Did you refresh/restart the server? Did you check for errors? Did you check if the resource you downloaded is magic or it has only some functions that you must use to make your things?
×
×
  • Create New...