Jump to content

[Help] Bloody Object ID


squaredb

Recommended Posts

Posted

Hey fellas, I am looking to find the object ID for the bloodpools seen around CJ. mta-screen_2012-11-14_09-11-33.jpg

Any ID lead will help. Ideas include the [ .dff file ID ]?, the [ object ID ]?, [ other ID ]?, any ID that will allow me to script createObject(bloodpool).

Thanks for your time.

Posted
I can do that, however fxAddBlood is a client side only function. I want and probably need to program my bloodpools server side. Still searching.

You can always use exported functions or triggers if anything. There is no "object ID" for blood pools since they are not objects.

Posted

Try this:

-- Server

function fxAddForAllClientsBlood(x, y, z, dx, dy, dz, c, b) 
     if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" or type(dx) ~= "number" or type(dy) ~= "number" or type(dz) ~= "number" then outputDebugString("Invalid arguments in fxAddForAllClientsBlood", 1) return end 
     if not c then c = 1 end 
     if not b then b = 1 end 
     triggerClientEvent(root, "onServerRequest_fxAddBlood", root, x, y, z, dx, dy, dz, c, b) 
end 

-- Client

addEvent("onServerRequest_fxAddBlood", true) 
addEventHandler("onServerRequest_fxAddBlood", root,  
function(x, y, z, dx, dy, dz, c, b) 
     fxAddBlood(x, y, z, dx, dy, dz, c, b) 
end ) 

Posted
Try this:

-- Server

function fxAddForAllClientsBlood(x, y, z, dx, dy, dz, c, b) 
     if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" or type(dx) ~= "number" or type(dy) ~= "number" or type(dz) ~= "number" then outputDebugString("Invalid arguments in fxAddForAllClientsBlood", 1) return end 
     if not c then c = 1 end 
     if not b then b = 1 end 
     triggerClientEvent(root, "onServerRequest_fxAddBlood", root, x, y, z, dx, dy, dz, c, b) 
end 

-- Client

addEvent("onServerRequest_fxAddBlood", true) 
addEventHandler("onServerRequest_fxAddBlood", root,  
function(x, y, z, dx, dy, dz, c, b) 
     fxAddBlood(x, y, z, dx, dy, dz, c, b) 
end ) 

A very great example in how it should be done.

Posted

triggerClientEvent has got some undefined number of arguments.

First argument is/are the element/s that will take part on the event. Since blood will be added for everybody we set ROOT.

Then, second argument, ofc the event.

Third argument is the SOURCE of the event. Since it's not important here we just set ROOT. After that, you can pass arguments (x, y, z, etc)

F/E if you wanted to trigger a Client Event for only ONE person, you can use as first argument getPlayerFromName(), just as an example.

With my code, if you want to create a blood that will be seen for everybody, do serverside:

fxAddForAllClientsBlood(x, y, z, dx, dy, dz, c, b) 

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