Jump to content

Problem with Export functions


SimpleNoob

Recommended Posts

Posted

Hello, im doing a system of vip money apart of the default gta's money, but i cant export the functions that i done, for example i want to get the number of money that have the target:

function getPVPMoney (target) 
return getElementData (target,"pvpmoney") 
end 

later when i use this function, debugscript throws an error saying that expected element not resource-data

Posted
function getPVPMoney (target) 
      if getElementType(target) ~= "player" then return end 
      return getElementData (target,"pvpmoney") or 0 -- if anyone has not the data it'll return 0. 
end 

Posted

With that functions returns nil

function test(player) 
local vipmoneys = getPVPMoney(player) 
  
outputChatBox("there is "..tostring(pvpmoneys)) 
end 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),test) 

Posted

Hello, thanks very much for the help provided by you, my script is working fine :D

but i have a problem, i exported the functions and i want to put the information on a visible dxDrawText, but the functions are serverside, how can i use it and get the money on a client script?

Posted
Hello, thanks very much for the help provided by you, my script is working fine :D

but i have a problem, i exported the functions and i want to put the information on a visible dxDrawText, but the functions are serverside, how can i use it and get the money on a client script?

You must get the element-data and put it at dxDrawText as string.

dxDrawText(tostring(getElementData (target,"pvpmoney")) or "0", x ,y ,w, h) 

Posted

but i have this error:

54893a480d95cd58889c8b13ce2d9638

and this is the code

dxDrawText(""..tostring(getELementData(getLocalPlayer(),"pvpmoney")).."", 1150*sW,530*sH,1150*sW,562*sH,tocolor(0,150,150,255), sH*1, "arial", "center", "center", false, false, true,false,false) 

where is the problem then?

Posted
dxDrawText(""..tostring(getElementData(getLocalPlayer(),"pvpmoney")).."", 1150*sW,530*sH,1150*sW,562*sH,tocolor(0,150,150,255), sH*1, "arial", "center", "center", false, false, true,false,false) 

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