Spawn* Posted October 23, 2012 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
Castillo Posted October 23, 2012 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Spawn* Posted October 23, 2012 Author 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.
Castillo Posted October 23, 2012 Posted October 23, 2012 Post your entire script. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Spawn* Posted October 23, 2012 Author 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))
Castillo Posted October 23, 2012 Posted October 23, 2012 May I ask, where's callServerFunction defined in your client side script? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Spawn* Posted October 23, 2012 Author Posted October 23, 2012 I must define it? I thought it was a simple native function like any other
Anderl Posted October 23, 2012 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 "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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