Easy way to set drawdistance to all functions/natives?
#1

Is there an easy way of setting every function drawdistance to any value.

For example the object streamer function, CreateDynamicObject:
pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0);
You could see that the default value for the 'streamdistance' is 200.0, is there an easy way of just setting al Objects to an other streamdistance, instead of setting it up in every function. Maybe something like hooking the function?

I know i can make it simpler to use a define and do this:
pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, .streamdistance = MAX_OBJECT_DRAW_DISTANCE);
But i think it's possible to do it on an other method, something like hooking that value and set it to all the CreateDynamicObject's.
Reply
#2

You could just edit the value in the include to whatever it is you want it to be.
Reply
#3

pawn Код:
#define FIXED_STREAM 300

stock CreateDynamicObject_fixedstream(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1)
{
      return CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, FIXED_STREAM);
}
Now use the above stock for all objects? Sorry if it's not what you're looking for, but this is easier
Reply
#4

I found a way of doing it:
pawn Код:
native _CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0) = CreateDynamicObject;
#define CreateDynamicObject _CreateDynamicObject
Thanks for the help guys, and also thanks to ****** with this post: http://forum.sa-mp.com/showpost.php?...8&postcount=10
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)