18.04.2013, 16:09
I still could not figure out I had to get this error, unfortunately, because of the passive one
Incognito, you can add a function to find out which zone is the player? ( GetPlayerDynamicArea(playerid); )
It would be very useful. Thanks. |
#include <a_samp>
#include <zcmd>
#include <streamer>
#define MAX_DYNAMIC_AREAS 100
#define INVALID_AREA_ID (0xFFF)
new DynamicAreaList[MAX_DYNAMIC_AREAS] = { INVALID_AREA_ID, ... };
stock GetPlayerDynamicAreas(playerid, areas[MAX_DYNAMIC_AREAS])
{
new findcount;
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
{
if(DynamicAreaList[i] == INVALID_AREA_ID) continue;
if(IsPlayerInDynamicArea(playerid, DynamicAreaList[i])) areas[findcount++] = DynamicAreaList[i];
}
}
stock GetDynamicAreaArray()
{
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
{
if(DynamicAreaList[i] == INVALID_AREA_ID) return i;
}
return INVALID_AREA_ID;
}
stock DestroyDynamicAreaEx(areaid)
{
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
{
if(DynamicAreaList[i] == areaid)
{
DestroyDynamicArea(areaid);
DynamicAreaList[i] = INVALID_AREA_ID;
return 1;
}
}
return 0;
}
// Usage
// Creating
public OnFilterScriptInit()
{
new Float:step;
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
{
DynamicAreaList[GetDynamicAreaArray()] = CreateDynamicSphere(0.0, step, 0.0, 20.0);
step += 5.0;
}
}
// Destroying
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++) { DestroyDynamicAreaEx(DynamicAreaList[i]); }
}
// Testing
CMD:getareas(playerid, arg[])
{
new areas[MAX_DYNAMIC_AREAS] = { INVALID_AREA_ID, ... };
GetPlayerDynamicAreas(playerid, areas);
new line[32];
for(new i = 0; i < MAX_DYNAMIC_AREAS; i++)
{
if(areas[i] != INVALID_AREA_ID)
{
format(line, sizeof(line), "You are in areaid: %i", areas[i]);
SendClientMessage(playerid, 0xFF00FFFF, line);
}
}
return 1;
}
// Teleport to testing area
CMD:000plz(playerid, arg[])
{
SetPlayerPos(playerid, 0.0, 0.0, 5.0);
return 1;
}
i set my CreateDynamicObject drawdistance to 600 but draw distance not changed in game,
Please help me to how set a distance for any object. |
The maximum stream distance for a non-LOD object is 300. This is a game limit, not a streamer limit. It cannot be changed.
|
MoveDynamicObject(object,PPOS[0],PPOS[1],PPOS[2],speed);
SetDynamicObjectRot(object, 0.0, 0.0, Angle2D(POS[0],POS[1],PPOS[0],PPOS[1]) + angle);