Spawn* Posted October 23, 2012 Share Posted October 23, 2012 Hi! I'm trying to make this function work for my system of registration and login... CLIENT: function callTeste() local rss = getLocalPlayer() callServerFunction("TestarFunc", rss) end addCommandHandler("teste_", callTeste) SERVER: function TestarFunc(player) outputChatBox("FUNCTION CALLED", player, 255, 0, 0, false) end but unfortunately I can not in any way if debugscript is activated the error that appears is this: attempt to call global "callServerFuntion" (a nil value) Help me please! And sorry for my bad English Link to comment
Castillo Posted October 23, 2012 Share Posted October 23, 2012 That's because they aren't native functions, you must copy the source code from here: https://wiki.multitheftauto.com/wiki/CallServerFunction Link to comment
Spawn* Posted October 23, 2012 Author Share Posted October 23, 2012 I copied this example but error still appeared... also I tried to do a test like this: callServerFunction ("spawnPlayer", rss, 0.0, 0.0, 0.0, 270.0) but did not work. Link to comment
Castillo Posted October 23, 2012 Share Posted October 23, 2012 Post your entire script. Link to comment
Spawn* Posted October 23, 2012 Author Share Posted October 23, 2012 I just started my gamemode, he has absolutely nothing... CLIENT: function callTeste() local rss = getLocalPlayer() callServerFunction("spawnPlayer", rss, 1679.2475, -2286.4585, 13.5290, 270.0) end addCommandHandler("teste_", callTeste) SERVER: function sInit() removeWorldModel(1257, 20000, 0.0, 0.0, 0.0) setGlitchEnabled("quickreload", false) setGlitchEnabled("fastmove", false) setGlitchEnabled("fastfire", false) tPED = createPed(286, 1680.5, -2286.4585, 13.5290, 270.0) end addEventHandler("onResourceStart", getRootElement(), sInit) ------------------------------------------------------------------------------------ function onPlayerEnter() outputChatBox("Bem-vindo ao MTA Freeroam MADE by Spawn*", source, 255, 0, 0, false) spawnPlayer(source, 1679.2475, -2286.4585, 13.5290, 270.0) fadeCamera(source, true) setCameraTarget(source, source) showPlayerHudComponent(source, "money", false) showPlayerHudComponent(source, "clock", false) setPlayerNametagShowing(source, true) giveWeapon(source, 17, 5) giveWeapon(source, 24, 57) giveWeapon(source, 25, 100) giveWeapon(source, 29, 330) bindKey(source, "R", "down", aReload) setPedArmor(source, 100) setPedStat(source, 24, 1000) setElementHealth(source, 175) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerEnter) even with "spawnPlayer" error remains the same (attempt to call global "callServerFuntion" (a nil value)) Link to comment
Castillo Posted October 23, 2012 Share Posted October 23, 2012 May I ask, where's callServerFunction defined in your client side script? Link to comment
Spawn* Posted October 23, 2012 Author Share Posted October 23, 2012 I must define it? I thought it was a simple native function like any other Link to comment
Anderl Posted October 23, 2012 Share Posted October 23, 2012 That's because they aren't native functions, you must copy the source code from here:https://wiki.multitheftauto.com/wiki/CallServerFunction 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