Help On CreatePlayerObject
#1

Hello guys i am using CreatePlayerObject but its having some issues i don't know why its not working properly when only 1 player join the server then its showing objects to him but when another player join the server and there are 5 or 6 players in server then its not showing objects to connected player here is my code see what is the problem

CreatePlayerObject function
PHP код:
forward ObjectSpawns(playerid);
public 
ObjectSpawns(playerid)
{
    for(new 
bs=0bs<=sizeof(ObjectSpawn); bs++)
    {
        new 
ObjID;
        new 
Float:obxFloat:obyFloat:obzFloat:obrxFloat:obryFloat:obrzFloat:distance[PLAYERS];
        new 
OIDs ObjectSpawn[bs][OID];
        
ObjID ObjectSpawn[bs][ObjectID];
        
obx ObjectSpawn[bs][objx];
        
oby ObjectSpawn[bs][objy];
        
obz ObjectSpawn[bs][objz];
        
obrx ObjectSpawn[bs][objrx];
        
obry ObjectSpawn[bs][objry];
        
obrz ObjectSpawn[bs][objrz];
        
distance[playerid] = GetPlayerDistanceFromPoint(playeridobxobyobz);
        if(
distance[playerid] < 200.00)
        {
                 if(
ObjectCreated[OIDs][playerid] == 0)
                 {
                      
ObjectCreated[OIDs][playerid] = CreatePlayerObject(playeridObjIDobxobyobzobrxobryobrz300.0);
                 }
        }
        else
                
DestroyPlayerObject(playeridObjectCreated[OIDs][playerid]);
                
ObjectCreated[OIDs][playerid] = 0;
        }
    }
    return 
1;

for showing objects
PHP код:
public OnPlayerUpdate(playerid)
{
  
ObjectSpawns(playerid);
  return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)