Jump to content

Call


Axel

Recommended Posts

Posted

Use exports instead.

ex:

exports["myResource"]:myFunction() 

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

call function needed that too, so I didn't think it was necessary.

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

What error do you get? is the resource running?

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

The ressource is running, there is no errors in the script (/debugscript 3),the script works alone, but calling/exports does not work..

Posted

What do you mean by "does not work"?

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

Are you sure the exported function is set to type="client" in the meta.xml?

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

Can you show me the script where you are using it?

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 haven't received any email.

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 meant, the script where you call that function from, not the script with the exported function.

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

Is that function in a client side script?

P.S: Did you add some debug outputs to the opGT function?

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

Why didn't you said that the script is not working at all? you named 3 labels with numbers, that's not possible, and that causes errors.

P.S. dxDrawText also has errors.

Edit: In general, your script is a total mess, full of bugs, is not the exported function the problem.

Edit2: I've fixed all the errors shown in the debugscript, but I don't know what is this, so you'll have to fix the rest.

x,y = guiGetScreenSize() 
l1 = guiCreateLabel(x,0,0,0,"",false) 
l2 = guiCreateLabel(x,0,0,0,"",false) 
l3 = guiCreateLabel(x,0,0,0,"",false) 
guiSetVisible(l1,false) 
guiSetVisible(l2,false) 
guiSetVisible(l3,false) 
gc1 = guiCreateLabel(x,0,0,0,"-65536",false) 
gc2 = guiCreateLabel(x,0,0,0,"-65536",false) 
gc3 = guiCreateLabel(x,0,0,0,"-65536",false) 
guiSetVisible(gc1,false) 
guiSetVisible(gc2,false) 
guiSetVisible(gc3,false) 
  
function deseneaza() 
x,y = guiGetScreenSize() 
t1 = guiGetText(l1) 
t2 = guiGetText(l2) 
t3 = guiGetText(l3) 
a = 0.02 
dxDrawText(t1,a*x,0.685*y,1,1,tocolor(255,255,255,255),1.2,"arial") 
dxDrawText(t2,a*x,0.655*y,1,1,tocolor(255,255,255,255),1.2,"arial") 
dxDrawText(t3,a*x,0.625*y,1,1,tocolor(255,255,255,255),1.2,"arial") 
end 
addEventHandler("onClientRender",root,deseneaza) 
  
setTimer( 
function() 
removeEventHandler("onClientRender", getRootElement(),deseneaza) 
end, 1300,0) 
  
function opGT(text,c1,c2,c3) 
local time = getRealTime() 
local hours = time.hour 
local minutes = time.minute 
local secs = time.second 
if hours < 10 then hours = "0"..hours end 
if minutes < 10 then minutes = "0"..minutes end 
if secs < 10 then secs = "0"..secs end 
theTime = hours..":"..minutes..":"..secs 
t1 = guiGetText(l1) 
t2 = guiGetText(l2) 
t3 = guiGetText(l3) 
guiSetText(l2,t1) 
guiSetText(l3,t2) 
tc1 = guiGetText(gc1) 
tc2 = guiGetText(gc2) 
tc3 = guiGetText(gc3) 
guiSetText(gc2,tc1) 
guiSetText(gc3,tc2) 
guiSetText(gc1,"["..theTime.."] "..text) 
c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) 
color = tocolor(c1,c2,c3) 
return "true: added text '"..text.."'" 
end 
  
setTimer(opGT,500,299,"Hello world",255,0,70) 
  
addEvent("callOpGT",true) 
addEventHandler("callOpGT",root, 
function(text,c1,c2,c3) 
opSGT(text,c1,c2,c3) 
end) 
  
function opSGT(text,c1,c2,c3) 
t1 = guiGetText(l1) 
t2 = guiGetText(l2) 
t3 = guiGetText(l3) 
guiSetText(l2,t1) 
guiSetText(l3,t2) 
tc1 = guiGetText(gc1) 
tc2 = guiGetText(gc2) 
tc3 = guiGetText(gc3) 
guiSetText(gc2,tc1) 
guiSetText(gc3,tc2) 
guiSetText(l1,text) 
c1,c2,c3 = tonumber(c1),tonumber(c2),tonumber(c3) 
color = tocolor(c1,c2,c3) 
end 

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'm pretty sure it is all right now, but still it does not output when i call it. It does when i start the ressource

(

setTimer(opGT,500,299,"Hello world",255,0,70)  

) but not when i call it..

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