Jump to content

callServerFunction - callClientFunction


papam77

Recommended Posts

Posted
I only need one script with this functions for example

example

callServerFunction("getServerMaps",getLocalPlayer()) end,500,1) 
  
  
function callServerFunction(funcname, ...) 
    local arg = { ... } 
    if (arg[1]) then 
        for key, value in next, arg do 
            if (type(value) == "number") then arg[key] = tostring(value) end 
        end 
    end 
    triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) 
end 

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted
Ty. And how can make bind around NPC ? max. 5 meters around.

You must be 5m maximum near to NPC and press "F" for call function.

you can use

  
createMarker 
onClientMarkerHit 
onClientMarkerLeave 
  

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted
Any one know how to move a marker not an object ?

You can use setElementPosition, or attach the marker to an invisible object and move the object then.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
I only need one script with this functions for example

example

callServerFunction("getServerMaps",getLocalPlayer()) end,500,1) 
  
  
function callServerFunction(funcname, ...) 
    local arg = { ... } 
    if (arg[1]) then 
        for key, value in next, arg do 
            if (type(value) == "number") then arg[key] = tostring(value) end 
        end 
    end 
    triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) 
end 

This is actually wrong because you are trying to call a function that hasn't been declared yet. Plus, the functions "callServerFunction" and "callClientFunction" cannot (but isn't hard to implement) return the value that is returned by the function called. The only thing in which these functions are good is that you don't need to add multiple events to do each thing.

I used to know how to code, but then I took an arrow in the knee.

Project Redivivus - Remaking Old School MTA With New Code

MTA 0.6 Nightly 1 released

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...