Jump to content

Ped- Server to Client


stroilep

Recommended Posts

alright, heres my problem.. i am trying to use the variable set for createPed on server side to the client side.. i tried putting the variable in the triggerServerEvent but dosnt work, maybe i am doing it wrong.. would be good if someone shed some light to my situation

for eg.

  
--serverside 
function createPed() 
ped = createPed(x,x,x,x) 
end 
--tried using triggerClientEvent inside another function to send the "ped" to client side 
--clientside 
--how do i use the "ped"? 
  
  

Link to comment

You should get the error; 'Stack Overflow'. Here is a small description about this error from Sean ( on stackoverflow )

Parameters and local variables are allocated on the stack (with reference types the object lives on the heap and a variable references that object). The stack typically lives at the upper end of your address space and as it is used up it heads towards the bottom of the address space (ie towards zero).

 

Your process also has a heap, which lives at the bottom end of your process. As you allocate memory this heap can grow towards the upper end of your address space. As you can see, there is the potential for the heap to "collide" with the stack (a bit like techtonic plates!!!).

 

The common cause for a stack overflow is a bad recursive call. Typically this is caused when your recursive functions doesn't have the correct termination condition, so it ends up calling itself for ever. However, with gui programming it's possible to generate indirect recursion. For example, your app may be handling paint messages and whilst processing them it may call a function that causes the system to send another paint message. Here you've not explicitly called yourself, but the OS/VM has done it for you.

 

To deal with them you'll need to examine your code. If you've got functions that call themselves then check that you've got a terminating condition. If you have then check than when calling the function you have at least modified one of the arguments, otherwise there'll be no visible change for the recusivly called function and the terminating condition is useless.

 

If you've got no obvious recursive functions then check to see if you're calling any library functions that indirectly will cause your function to be called .

source; http://stackoverflow.com/questions/2147 ... flow-error

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