SA-MP Forums Archive
problem with 3Dlabel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: problem with 3Dlabel (/showthread.php?tid=313123)



problem with 3Dlabel - mhamadsaleh - 24.01.2012

Hi i got a problem with 3DLabel it dose not disabear
Please help me if you can
here is the code
PHP код:
new Text3D:Label[MAX_PLAYERS];
dcmd_onduty(playerid,params[]) 

    
#pragma unused params 
    
if (AccInfo[playerid][Level] >= 1
    { 
        if(
AccInfo[playerid][OnDuty] == 0
        { 
            new 
string[240]; 
            new 
AdminName[MAX_PLAYER_NAME]; 
            
GetPlayerName(playeridAdminNamesizeof(AdminName)); 
            
AccInfo[playerid][OnDuty] = 1
             
SetPlayerHealth(playerid,100000); 
            
GivePlayerWeapon(playerid,31,100000); GivePlayerWeapon(playerid,16,100000); 
             
GivePlayerWeapon(playerid,34,100000); GivePlayerWeapon(playerid,29,100000); 
            
GivePlayerWeapon(playerid,38,100000); GivePlayerWeapon(playerid,24,100000); 
            
GivePlayerWeapon(playerid,26,100000); GivePlayerWeapon(playerid,4,1); 
            
Attach3DTextLabelToPlayer(Label[playerid], playerid0.00.01.0 ); 
            
Label[playerid] = Create3DTextLabel("ADMIN ON DUTY[DONT ATTACK]"red30.040.050.040.00); 
            
format(stringsizeof(string),"[ADMIN]: %s is now on Admin Duty"AdminName); 
            
AccInfo[playerid][God] = 1
             return 
SendClientMessageToAll(green,string); 
        } 
        else 
        { 
            new 
string[240]; 
            new 
AdminName[MAX_PLAYER_NAME]; 
            
GetPlayerName(playeridAdminNamesizeof(AdminName)); 
            
AccInfo[playerid][OnDuty] = 0
            
ResetPlayerWeapons(playerid); 
            
SetPlayerHealth(playerid,100); 
            
SetPlayerArmour(playerid,0); 
            
Delete3DTextLabel(Label[playerid]); 
            
format(stringsizeof(string),"[ADMIN]: %s is now Off Admin Duty"AdminName); 
             
AccInfo[playerid][God] = 0
             return 
SendClientMessageToAll(orange,string); 
        } 
    } 
    return 
SendClientMessage(playerid,orange,"Your level is not high enough"); 




Re: problem with 3Dlabel - lordturhan - 24.01.2012

pawn Код:
new Text3D:Label[MAX_PLAYERS];
dcmd_onduty(playerid,params[])
{
    #pragma unused params
    if (AccInfo[playerid][Level] >= 1)
    {
        if(AccInfo[playerid][OnDuty] == 0)
        {
            new string[240];
            new AdminName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, AdminName, sizeof(AdminName));
            AccInfo[playerid][OnDuty] = 1;
             SetPlayerHealth(playerid,100000);
            GivePlayerWeapon(playerid,31,100000); GivePlayerWeapon(playerid,16,100000);
             GivePlayerWeapon(playerid,34,100000); GivePlayerWeapon(playerid,29,100000);
            GivePlayerWeapon(playerid,38,100000); GivePlayerWeapon(playerid,24,100000);
            GivePlayerWeapon(playerid,26,100000); GivePlayerWeapon(playerid,4,1);
            Label[playerid] = Create3DTextLabel("ADMIN ON DUTY[DONT ATTACK]", red, 30.0, 40.0, 50.0, 40.0, 0);
            Attach3DTextLabelToPlayer(Label[playerid], playerid, 0.0, 0.0, 1.0 );
            format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty", AdminName);
            AccInfo[playerid][God] = 1;
             return SendClientMessageToAll(green,string);
        }
        else
        {
            new string[240];
            new AdminName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, AdminName, sizeof(AdminName));
            AccInfo[playerid][OnDuty] = 0;
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid,0);
            Delete3DTextLabel(Label[playerid]);
            format(string, sizeof(string),"[ADMIN]: %s is now Off Admin Duty", AdminName);
             AccInfo[playerid][God] = 0;
             return SendClientMessageToAll(orange,string);
        }
    }
    return SendClientMessage(playerid,orange,"Your level is not high enough");
}
Try this not sure it will work though