Problem with a pickup over a head
#1

There is no pickup

Код:
new HeadPickup[MAX_PLAYERS]; 
new Text3D:label[MAX_PLAYERS];  

public OnPlayerDisconnect(playerid, reason) 
{ 
  Delete3DTextLabel(label[playerid]); 
     if(IsValidObject(HeadPickup[playerid]))    DestroyObject(HeadPickup[playerid]); 
  return 1; 
} 

public OnPlayerSpawn(playerid) 
{ 
  if(!IsValidObject(HeadPickup[playerid])) 
  { 
      new string[256],pname[20]; 
      GetPlayerName(playerid,pname,sizeof(pname)); 
    format(string,sizeof(string),"%s(%d)",pname,playerid); 
    if(GetPlayerColor(playerid) == 0) label[playerid] = Create3DTextLabel(string,0xFF8C13FF,0.0,0.0,0.0,0.0,0); 
    else label[playerid] = Create3DTextLabel(string,GetPlayerColor(playerid),0.0,0.0,0.0,0.0,0); 
    HeadPickup[playerid] = CreateObject(1559,0.0,0.0,0.0,0.0,0.0,0.0); 
   } 
  return 1; 
} 

public OnPlayerUpdate(playerid) 
{ 
  if(!IsValidObject(HeadPickup[playerid])) 
  { 
      new Float:pX,Float:pY,Float:pZ; 
   GetPlayerPos(playerid,pX,pY,pZ); 
      AttachObjectToPlayer(HeadPickup[playerid],playerid,pX,pY,pZ+3,0.0,0.0,0.0); 
      Attach3DTextLabelToPlayer(label[playerid],playerid,pX,pY,pZ+4); 
  } 
  return 1; 
} 

public OnPlayerDeath(playerid, killerid, reason) 
{ 
     if(IsValidObject(HeadPickup[playerid]))    DestroyObject(HeadPickup[playerid]); 
  return 1; 
}
What not so?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)