Return value
#1

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    if(!
IsPlayerNPC(playerid))
    {
        if(
pInfo[playerid][pLogged] == 1) { SaveStats(playerid); }
               
DestroyDynamic3DTextLabel(PlayerLabel[playerid]);
         
PlayersAlive--;
          
ResetVars(playerid);
        
DisconnectVars(playerid);
        
DeletePlayerTD(playerid);
        new 
str[256];
          switch(
reason)
        {
            case 
0format(str,sizeof(str),"*"COL_GREEN" %s(%i) a iesit de pe server. Motiv: Timed Out",PlayerName(playerid),playerid);
            case 
1format(str,sizeof(str),"*"COL_GREEN" %s(%i) a iesit de pe server. Motiv: Leaving",PlayerName(playerid),playerid);
            case 
2format(str,sizeof(str),"*"COL_GREEN" %s(%i) a iesit de pe server. Motiv: Kicked/Banned",PlayerName(playerid),playerid);
        }
        
SendMessageToAllAdmins(str,-1);
         if(
IsBeingSpeced[playerid] == 1)
        {
            foreach(
Player,i)
            {
                if(
spectatorid[i] == playerid)
                {
                    
TogglePlayerSpectating(i,false);
                    
giveWeaponAllow[i] = 1;
                }
            }
        }
    }
    return 
1;


I need to return a value to if(!IsPlayerNPC(playerid)) because my Dynamicnametag is not deleting on leaving.
Reply
#2

help ?
Reply
#3

I don't get what you're asking.
If you want to destroy an NPC's dynamic 3D label, you need to do it outside of the !IsPlayerNPC check.

Also, don't bump before 24 hours.. The rules are there for a reason!
Reply
#4

I use it for a player, not for NPC


PHP код:
if(pInfo[playerid][pLogged] == 1) { SaveStats(playerid); } 
               
DestroyDynamic3DTextLabel(PlayerLabel[playerid]); 
         
PlayersAlive--; 
          
ResetVars(playerid); 
        
DisconnectVars(playerid); 
        
DeletePlayerTD(playerid); 
i have no return there and when a player with ID 1 /quits, and another player connects and gets ID 1, his nametag get's overlayed to the last ID 1 player.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)