Jump to content

problem with triggerServerEvent


John Smith

Recommended Posts

hi im having some impossible problem which makes zero sense.

  
-- client 
triggerServerEvent("onSpawnRequest",localPlayer,spawnvehicle,posX,posY,posZ,rotX,rotY,rotZ,interior,alpha); 
  
-- server 
function asd(spawnvehicle,x,y,z,rotx,roty,rotz,interior,alpha) 
    outputChatBox(tostring(spawnvehicle)); 
end; 
  

On client side spawnvehicle is 411 (infernus vehicle id) and somehow on server side spawnvehicle argument is using x argument's value, so it's a coordinate instead of 411

why is that happening???????

Link to comment

I sometimes come across this. My solution is just to add a dummy parameter at the beginning. Always seems to work for me.

  
-- client 
triggerServerEvent("onSpawnRequest",localPlayer,spawnvehicle,posX,posY,posZ,rotX,rotY,rotZ,interior,alpha); 
  
-- server 
function asd(_, spawnvehicle,x,y,z,rotx,roty,rotz,interior,alpha) 
    outputChatBox(tostring(spawnvehicle)); 
end; 

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