Help me.
#6

I wrote you a new code. It should work, I haven't tested it yet. Let me know if it works.

PHP код:
// Make sure if you add levels change this defines and then add the respective level name into the correspond array below.
#define MAX_ADMIN_LEVELS 6
#define MAX_VIP_LEVELS 6
// This will work better instead of switching the player level/vip everytime he spawns.
new PlayerAdminLevelTagNames[MAX_ADMIN_LEVELS][] = {"Tester""(Co-Moderator)""(Moderator)""(Admin)""(Leader)""(Manager/CEO)"},
    
PlayerVIPLevelTagNames[MAX_VIP_LEVELS][] = {"(Bronze VIP 1)""(Bronze VIP 2)""(Silver VIP 1)""(Silver VIP 1)""(Gold VIP 5)""(Premium VIP 6)"},
    
Text3D:Admin_PlayerLabel[MAX_PLAYERS] = {Text3D:INVALID_3DTEXT_ID, ...},
    
Text3D:VIP_PlayerLabel[MAX_PLAYERS]= {Text3D:INVALID_3DTEXT_ID, ...}
;
public 
OnPlayerSpawn(playerid)
{
    
// If the player level is More than 0 And Less or equal to MAX_ADMIN_LEVELS and NO labels has been created for the player then..
    
if( PlayerInfo[playerid][Level] <= MAX_ADMIN_LEVELS && Admin_PlayerLabel[playerid] != Text3D:INVALID_3DTEXT_ID)
    {
        
// Create the label with the corresponding level Name from the Array / NOTE: Only players in virtual world 0 will see the label!
        
Admin_PlayerLabel[playerid] = Create3DTextLabel(PlayerAdminLevelTagNames[PlayerInfo[playerid][Level] - 1], lightblue0.00.00.040.00);
        
Attach3DTextLabelToPlayer(Admin_PlayerLabel[playerid], playerid0.00.00.4);
    }
    
// Same, but using the VIP Label (MAX_VIP_LEVELS)
    
if( PlayerInfo[playerid][pVip] <= MAX_VIP_LEVELS && VIP_PlayerLabel[playerid] != Text3D:INVALID_3DTEXT_ID)
    {
        
VIP_PlayerLabel[playerid] = Create3DTextLabel(PlayerVIPLevelTagNames[PlayerInfo[playerid][pVip] - 1], yellow0.00.00.040.00);
        
Attach3DTextLabelToPlayer(VIP_PlayerLabel[playerid], playerid0.00.00.8); // Changed the Z-offset. What if the player is also an Admin?
    
}
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
Delete3DTextLabel(Admin_PlayerLabel[playerid]);
    
Delete3DTextLabel(VIP_PlayerLabel[playerid]);
    return 
1;

I recommend you to download the Streamer by Incognito, you can create 3D Text labels easily. You have more options using a streamer, like changing the virtual world, interior, attach it directly to a player, vehicle, etc.
PHP код:
Text3D:CreateDynamic3DTextLabel(const text[], colorFloat:xFloat:yFloat:zFloat:drawdistanceattachedplayer INVALID_PLAYER_IDattachedvehicle INVALID_VEHICLE_IDtestlos 0worldid = -1interiorid = -1playerid = -1Float:streamdistance 100.0); 
Reply


Messages In This Thread
3D Lablels help - by VZMatt - 10.06.2016, 03:42
Re: Help me. - by CSLangdale - 10.06.2016, 03:46
Respuesta: Help me. - by VZMatt - 10.06.2016, 03:47
Re: Help me. - by CSLangdale - 10.06.2016, 03:53
Respuesta: Help me. - by VZMatt - 10.06.2016, 03:57
Re: Help me. - by Jf - 10.06.2016, 05:36
Re: Help me. - by d1git - 10.06.2016, 05:39
Re: Help me. - by Stinged - 10.06.2016, 07:38

Forum Jump:


Users browsing this thread: 1 Guest(s)