13.01.2014, 22:40
(
Последний раз редактировалось ikey07; 13.01.2014 в 23:26.
)
It has something to do with afking + run server for a while + many objects being destroyed/created
Try with this code
Tho those objects which are created on server init, doesn't disappear, just such things as cones etc which are being created/destroyed in gameplay, also they sometimes not creating at all, and what Im noticed that sometimes when I come back from afk, I see an object, but when I move abit it disappears, and not coming back.
Just reproduced, video:
[ame]http://www.youtube.com/watch?v=AJI-Rpp4QwI[/ame]
/fixmap cmd is made specially for this issue, it destroy and create object again, as you can see in 1st part and 2nd, the same cells was missing, 2nd video I made after I reload object creator and created the same fence, after I came back from afk and moved those objects issue accured, also sry about lags at the 2nd part, HDD is almost full :S
Try with this code
pawn Код:
#include <a_samp>
#include <streamer>
enum conInfo
{
bCreated,Float:bX,Float:bY,Float:bZ,Float:bR,bObject,bModel
};
new Coninfo[1000][conInfo];
CreateCone(playerid,type)
{
for(new i = 0; i < sizeof(Coninfo); i++)
{
if(Coninfo[i][bCreated] == 0)
{
GetPlayerPos(playerid,Coninfo[i][bX],Coninfo[i][bY],Coninfo[i][bZ]);
GetPlayerFacingAngle(playerid,Coninfo[i][bR]);
Coninfo[i][bCreated] = 1;
if(type == 0) { Coninfo[i][bModel] = 1238; Coninfo[i][bZ] = Coninfo[i][bZ]-0.71; }
else if(type == 1) { Coninfo[i][bModel] = 1237; Coninfo[i][bZ] = Coninfo[i][bZ]-1.01; }
if(random(2) == 0)
{
Coninfo[i][bObject] = CreateDynamicObject(Coninfo[i][bModel],Coninfo[i][bX]+random(50),Coninfo[i][bY]-random(50),Coninfo[i][bZ],0,0,Coninfo[i][bR],-1,-1,-1,200.0);
}
else
{
Coninfo[i][bObject] = CreateDynamicObject(Coninfo[i][bModel],Coninfo[i][bX]-random(50),Coninfo[i][bY]+random(50),Coninfo[i][bZ],0,0,Coninfo[i][bR],-1,-1,-1,200.0);
}
for(new user; user < MAX_PLAYERS; user++)
{
if(IsPlayerConnected(user) && IsPlayerInRangeOfPoint(user,50.0,Coninfo[i][bX],Coninfo[i][bY],Coninfo[i][bZ]))
{
Streamer_UpdateEx(user,Coninfo[i][bX],Coninfo[i][bY],Coninfo[i][bZ]);
}
}
return 1;
}
}
return 0;
}
DeleteCone()
{
for(new i = 0; i < sizeof(Coninfo); i++)
{
if(Coninfo[i][bCreated] == 1)
{
Coninfo[i][bCreated] = 0; Coninfo[i][bX] = 0.0; Coninfo[i][bY] = 0.0; Coninfo[i][bZ] = 0.0;
DestroyDynamicObject(Coninfo[i][bObject]);
}
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/conex", cmdtext, true))
{
for(new i; i < sizeof(Coninfo); i++)
{
CreateCone(playerid,random(2));
}
SendClientMessage(playerid,-1,"Cones created.");
return 1;
}
else if (!strcmp("/rconex", cmdtext, true))
{
DeleteCone();
SendClientMessage(playerid,-1,"Cones deleted.");
return 1;
}
return 0;
}
Tho those objects which are created on server init, doesn't disappear, just such things as cones etc which are being created/destroyed in gameplay, also they sometimes not creating at all, and what Im noticed that sometimes when I come back from afk, I see an object, but when I move abit it disappears, and not coming back.
Just reproduced, video:
[ame]http://www.youtube.com/watch?v=AJI-Rpp4QwI[/ame]
/fixmap cmd is made specially for this issue, it destroy and create object again, as you can see in 1st part and 2nd, the same cells was missing, 2nd video I made after I reload object creator and created the same fence, after I came back from afk and moved those objects issue accured, also sry about lags at the 2nd part, HDD is almost full :S