Jump to content

Help with callServerFunction


Spawn*

Recommended Posts

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 :cry: 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 :oops:

Link to comment

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)) :cry:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...