Erstmal schöner Streamer, aber wie kann ich diese Funktionen (Aus Double-O-Objects) so umschreiben dass ich sie mit diesem Streamer nutzen kann?
public StreamObjects(playerid)
{
if(IsPlayerConnected(playerid))
{
new worldid=GetPlayerVirtualWorld(playerid),Float:currentx,Float:currenty,Float:currentz;
GetPlayerPos(playerid,PlayerObjectInfo[playerid][pLastStreamPos][0],PlayerObjectInfo[playerid][pLastStreamPos][1],PlayerObjectInfo[playerid][pLastStreamPos][2]);
for(new i=0;i<MAX_STREAM_OBJECTS;i++)
{
if(ObjectInfo[i][oCreated])
{
GetStreamObjectPos(i,currentx,currenty,currentz);
if(IsPlayerInRangeOfPoint(playerid,ObjectInfo[i][oDistance],currentx,currenty,currentz) && (ObjectInfo[i][oWorld]==ALL_WORLDS || ObjectInfo[i][oWorld]==worldid))
{
if(PlayerObjectInfo[playerid][pObjectID][i]==INVALID_OBJECT_ID && PlayerObjectInfo[playerid][pObjectCount]<MAX_OBJECTS)
{
PlayerObjectInfo[playerid][pObjectID][i]=CreatePlayerObject(playerid,ObjectInfo[i][oModel],currentx,currenty,currentz,ObjectInfo[i][oRotation][0],ObjectInfo[i][oRotation][1],ObjectInfo[i][oRotation][2]);
PlayerObjectInfo[playerid][pObjectCount]++;
if(ObjectInfo[i][oMoving])
MovePlayerObject(playerid,PlayerObjectInfo[playerid][pObjectID][i],ObjectInfo[i][oPos][0],ObjectInfo[i][oPos][1],ObjectInfo[i][oPos][2],ObjectInfo[i][oMoveSpeed]);
}
}
else
{
if(PlayerObjectInfo[playerid][pObjectID][i]!=INVALID_OBJECT_ID)
{
DestroyPlayerObject(playerid,PlayerObjectInfo[playerid][pObjectID][i]);
PlayerObjectInfo[playerid][pObjectID][i]=INVALID_OBJECT_ID;
PlayerObjectInfo[playerid][pObjectCount]--;
}
}
}
}
return 1;
}
return 0;
}
public StreamObjectsEx(playerid,Float:x,Float:y,Float:z)
{
if(IsPlayerConnected(playerid))
{
new worldid=GetPlayerVirtualWorld(playerid),Float:currentx,Float:currenty,Float:currentz;
PlayerObjectInfo[playerid][pLastStreamPos][0]=x;
PlayerObjectInfo[playerid][pLastStreamPos][1]=y;
PlayerObjectInfo[playerid][pLastStreamPos][2]=z;
for(new i=0;i<MAX_STREAM_OBJECTS;i++)
{
if(ObjectInfo[i][oCreated])
{
GetStreamObjectPos(i,currentx,currenty,currentz);
if(IsPosInDistance(x,y,z,currentx,currenty,currentz,ObjectInfo[i][oDistance]) && (ObjectInfo[i][oWorld]==ALL_WORLDS || ObjectInfo[i][oWorld]==worldid))
{
if(PlayerObjectInfo[playerid][pObjectID][i]==INVALID_OBJECT_ID && PlayerObjectInfo[playerid][pObjectCount]<MAX_OBJECTS)
{
PlayerObjectInfo[playerid][pObjectID][i]=CreatePlayerObject(playerid,ObjectInfo[i][oModel],currentx,currenty,currentz,ObjectInfo[i][oRotation][0],ObjectInfo[i][oRotation][1],ObjectInfo[i][oRotation][2]);
PlayerObjectInfo[playerid][pObjectCount]++;
if(ObjectInfo[i][oMoving])
MovePlayerObject(playerid,PlayerObjectInfo[playerid][pObjectID][i],ObjectInfo[i][oPos][0],ObjectInfo[i][oPos][1],ObjectInfo[i][oPos][2],ObjectInfo[i][oMoveSpeed]);
}
}
else
{
if(PlayerObjectInfo[playerid][pObjectID][i]!=INVALID_OBJECT_ID)
{
DestroyPlayerObject(playerid,PlayerObjectInfo[playerid][pObjectID][i]);
PlayerObjectInfo[playerid][pObjectID][i]=INVALID_OBJECT_ID;
PlayerObjectInfo[playerid][pObjectCount]--;
}
}
}
}
return 1;
}
return 0;
}