YoUnG Generation Gaming

User Desk => Tutorials => Topic started by: Lordz on December 31, 2013, 07:34:21 PM

Title: How to fix the Streamer's Draw Distance Issue
Post by: Lordz on December 31, 2013, 07:34:21 PM
Fixing the Draw Distance Issue!

Hello,
This topic has been created for the ones who maps and uses Incognito's Streamer Plugin! I've been facing some issues with the draw distance setting with the Streamer's plugin and came to know about fixing it. I've made it as an include mode and also hooks up with the original "CreateDynamicObject" code in case if you want to.

Usage

You can download it from the links which is specified down and then place it on "/pawno/include" directory. The include is named as "CreateStreamedObject.inc".

Open PAWNO, and include CreateStreamedObject under streamer. This is how it would look like:

Code: [Select]
#include <a_samp>
#include <streamer>
#include <CreateStreamedObject>

Instead of using CreateDynamicObject, then use CreateStreamedObject. This include also supports hooking, so if you want the whole script to use the draw distance you specify, before including, do "#define REPLACE_CreateDynamicObject". It'd look like this:

Code: [Select]
#include <a_samp>
#include <streamer>
#define REPLACE_CreateDynamicObject
#include <CreateStreamedObject>

NOTE : This is used in case if you're testing it separately, not on the map editor's Test or any other editors Test.

Download

Direct Code
Code: [Select]
/*
--------------------------------------------------------------------------------
?               CreateStreamedObject - Streamer DrawDistance fix!              ?
?               Usage :                                                        ?
? If you want to replace your CreateDynamicObject codes,         ?
? Before including, do #define REPLACE_CreateDynamicObject.      ?
?               If you don't want it to replace then, use                      ?
?               #undef REPLACE_CreateDynamicObject                             ?
?               Credits goes to those who have told about setting the          ?
? data via Streamer_SetFloatData.                                ?
Lordz, for creating as an include and hooks.                   ?
--------------------------------------------------------------------------------
*/

#if defined _included_createstreamedobject
 #endinput
#endif

#define _included_createstreamedobject

#include <a_samp>
#include <streamer>

stock CreateStreamedObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, vworld = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0, Float:drawdistance = 300.0)
{
 new Object_ID = CreateDynamicObject(modelid, X, Y, Z, rX, rY, rZ, vworld, interiorid, playerid, streamdistance);
 Streamer_SetFloatData(STREAMER_TYPE_OBJECT, Object_ID, E_STREAMER_DRAW_DISTANCE, drawdistance);
 return Object_ID;
}

#if defined REPLACE_CreateDynamicObject
 #define CreateDynamicObject CreateStreamedObject
#endif
Solid Files (http://www.solidfiles.com/d/a14a37f197/)
Paste Bin (http://pastebin.com/xG1Y9QaP)
Title: Re: How to fix the Streamer's Draw Distance Issue
Post by: Kirito on January 01, 2014, 10:52:17 AM
Nice Bro :) Thanks But idk how to use xD
Title: Re: How to fix the Streamer's Draw Distance Issue
Post by: Mortalis on January 01, 2014, 01:54:33 PM
LoL. Thanks for include.  ;)  This give ease rather filling every part of the parameters. +rep  :P I already made a test and it works perfectly.
Title: Re: How to fix the Streamer's Draw Distance Issue
Post by: KiRaN on January 01, 2014, 02:48:46 PM
Nice Bro :) Thanks But idk how to use xD

Hi5 bro :/

Btw ,

Thnx for sharing and it will help those who script here :)