[Ajuda] Tag [VIP]
#1

Ola queria saber como eu coloco uma tag de vip no nome dos vips la no chat quando ele digitar aparecer em amarelo NomedoPlayer [VIP]

Olha meu sistem de vip aew
PHP код:
#include <a_samp>
#include <DOF2>
#include <zcmd>
#include <sscanf>
#define Maximo_Players 100
#define Preco_Vip 10
#define Dial_Vip 7000
new VIP[Maximo_Players];
new 
Fala[128];
new 
Nome[24];
public 
OnFilterScriptInit()
{
        print(
"Ultimate VIP 0.3x iniciado.");
        print(
"Criador: Biel_COP.");
        return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"Ultimate VIP 0.3x encerrado.");
        print(
"Criador: Biel_COP.");
        
DOF2_Exit();
        return 
1;
}
public 
OnPlayerConnect(playerid)
{
        
GetPlayerName(playerid,Nome,sizeof(Nome));
        
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
        if(
DOF2_FileExists(Fala))
        {
            
VIP[playerid] = 1;
        }
        return 
1;
}
public 
OnPlayerDisconnect(playerid,reason)
{
        
VIP[playerid] = 0;
    
GetPlayerName(playerid,Nome,sizeof(Nome));
        
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
        if(
DOF2_FileExists(Fala))
        {
                
DOF2_SaveFile();
        }
        return 
1;
}
public 
OnPlayerSpawn(playerid)
{
        if(
VIP[playerid] == 1)
        {
                
GameTextForPlayer(playerid,"~r~Voce e um Player VIP Aproveite",5000,3);
        }
        return 
1;
}
public 
OnPlayerUpdate(playerid)
{
        if(
VIP[playerid] == 1)
        {
                
GetPlayerName(playerid,Nome,sizeof(Nome));
                
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
                if(
DOF2_FileExists(Fala))
                {
                        new 
Hoje getdate();
                        new 
Vencimento DOF2_GetInt(Fala,"Vencimento");
                        new 
Dias DOF2_GetInt(Fala,"Dias");
                        if(
Hoje-Vencimento >= Dias)
                        {
                            
format(Fala,sizeof(Fala),"Olб %s, seu VIP expirou.\n\nPossнvel motivo: Vencimento.\n\nEsperamos que tenha aproveitado!\n\nPreзo do VIP: R$ %d,00",Nome,Preco_Vip);
                                
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
                                
RemoverVip(playerid);
                        }
                }
                else
                {
                    
format(Fala,sizeof(Fala),"Olб %s, seu VIP expirou.\n\nPossнvel motivo: Sua conta na pasta nгo existe mais.\n\nEsperamos que tenha aproveitado!\n\nPreзo do VIP: R$ %d,00",Nome,Preco_Vip);
                        
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"VIP Expirado",Fala,"Cancelar","");
                        
RemoverVip(playerid);
                }
        }
        return 
1;
}
public 
OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
        if(
dialogid == Dial_Vip)
        {
            if(
response)
            {
                if(!
strlen(inputtext))
                {
                
ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
                }
                else
                {
                    for(new 
i=0i<Maximo_Playersi++)
                    {
                                        if(
IsPlayerConnected(i))
                                        {
                                            if(
VIP[i] == 1)
                                            {
                                                
GetPlayerName(playerid,Nome,sizeof(Nome));
                                                        
format(Fala,sizeof(Fala),"VIP %s: %s",Nome,inputtext);
                                                        
SendClientMessage(i,0xEDB2DEAA,Fala);
                                                }
                                        }
                                }
                        }
                        return 
1;
                }
        }
        return 
1;
}
forward RemoverVip(playerid);
public 
RemoverVip(playerid)
{
        
VIP[playerid] = 0;
    
GetPlayerName(playerid,Nome,sizeof(Nome));
        
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
        if(
DOF2_FileExists(Fala))
        {
            
DOF2_RemoveFile(Fala);
        }
        return 
1;
}
CMD:vips(playerid)
{
        
SendClientMessage(playerid,0xBFBFBFAA,"Vips Online:");
        for(new 
i=0i<Maximo_Playersi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
VIP[i] == 1)
                {
                                
format(Fala,sizeof(Fala),"VIP: %s.",Nome);
                                
SendClientMessage(playerid,0xBBFF00AA,Fala);
                        }
                }
        }
        return 
1;
}
CMD:roupavip(playerid,params[])
{
        new 
ID;
        if(
VIP[playerid] == 1)
        {
            if(!
sscanf(params,"d",ID))
            {
                        
SendClientMessage(playerid,0xBFBFBFAA,"Use: /roupavip ID.");
                        return 
1;
                }
                if(
ID 299)
                {
                    if(
ID 0)
                    {
                        
SendClientMessage(playerid,0xBFBFBFAA,"Roupas de 0 a 299.");
                                return 
1;
                        }
                }
                else
                {
                    
SetPlayerSkin(playerid,ID);
                    
GameTextForPlayer(playerid,"~r~Roupa Trocada",5000,3);
            }
        }
        return 
1;
}
CMD:vip(playerid)
{
        if(
VIP[playerid] == 1)
        {
            
ShowPlayerDialog(playerid,Dial_Vip,DIALOG_STYLE_MSGBOX,"Bate Papo VIP","Escreva o texto no campo abaixo","Escrever","Cancelar");
        }
        return 
1;
}
CMD:bvip(playerid)
{
    
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Beneficios VIP","Comando /armasvip disponнvel para uso.\n\nComando /roupavip disponнvel para uso.\n\nComando /majvip disponнvel para uso.\n\nAtendimento mais atencioso.\n\nNome no /vips, com direito ao bate papo.","Cancelar","");
        return 
1;
}
CMD:cvip(playerid)
{
        if(
VIP[playerid] == 1)
        {
            
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Ajuda VIP","/vips, /roupavip\n\n/vip, /bvip\n\n/creditosvip, /cvip, /planosvip\n\n /reparar","Cancelar","");
        }
        if(
IsPlayerAdmin(playerid))
        {
            
SendClientMessage(playerid,0xFFFF00AA,"/darvip, /removervip");
        }
        return 
1;
}
CMD:planosvip(playerid)
{
        
format(Fala,sizeof(Fala),"O VIP custa R$ %d,00.\n\nAproveite e compre!",Preco_Vip);
        
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Planos VIP",Fala,"Cancelar","");
        return 
1;
}
CMD:darvip(playerid,params[])
{
        new 
ID;
        new 
Dias;
        if(
IsPlayerAdmin(playerid))
        {
            if(!
sscanf(params,"dd",ID,Dias))
            {
                
SendClientMessage(playerid,0xBFBFBFAA,"Use: /darvip ID Dias.");
                return 
1;
                }
                if(!
IsPlayerConnected(ID))
                {
                    
SendClientMessage(playerid,0xBFBFBFAA,"Player nгo online.");
                return 
1;
                }
                else
                {
                        if(
VIP[ID] == 1)
                        {
                            
SendClientMessage(playerid,0xBFBFBFAA,"O mesmo Jб й VIP.");
                            return 
1;
                        }
                        else
                        {
                            
GetPlayerName(ID,Nome,sizeof(Nome));
                                
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
                                
DOF2_CreateFile(Fala);
                                
DOF2_SetInt(Fala,"Vencimento",getdate());
                                
DOF2_SetInt(Fala,"Dias",Dias);
                                
DOF2_SaveFile();
                                
VIP[ID] = 1;
                                
format(Fala,sizeof(Fala),"O administrador deu VIP para o player %s por %d dias.",Nome,Dias);
                                
SendClientMessageToAll(0xFF8080AA,Fala);
                        }
                }
        }
        return 
1;
}
CMD:removervip(playerid,params[])
{
        new 
ID;
        if(
IsPlayerAdmin(playerid))
        {
            if(!
sscanf(params,"d",ID))
            {
                
SendClientMessage(playerid,0xBFBFBFAA,"Use: /removervip ID.");
                return 
1;
                }
                if(!
IsPlayerConnected(ID))
                {
                    
SendClientMessage(playerid,0xBFBFBFAA,"Player nгo online.");
                return 
1;
                }
                else
                {
                        if(
VIP[ID] == 0)
                        {
                            
SendClientMessage(playerid,0xBFBFBFAA,"O mesmo nгo й VIP.");
                            return 
1;
                        }
                        else
                        {
                            
GetPlayerName(ID,Nome,sizeof(Nome));
                                
format(Fala,sizeof(Fala),"Vips/%s.ini",Nome);
                                
DOF2_RemoveFile(Fala);
                                
VIP[ID] = 0;
                                
format(Fala,sizeof(Fala),"O administrador removeu o VIP do player %s.",Nome);
                                
SendClientMessageToAll(0xFF8080AA,Fala);
                        }
                }
        }
        return 
1;
}
CMD:reparar(playerid,params[])
{
        if(
VIP[playerid] == 1)
        {
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFFFFFFFF"Vocк Nao estar em um veiculo!");
        
RepairVehicle(GetPlayerVehicleID(playerid));
        
SendClientMessage(playerid0xFFFFFFFF"Seu carro foi reparado!");
        return 
1;
    }

Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
        if(VIP[playerid] == 1)
        {
    new messagetext[128], pname[MAX_PLAYER_NAME];
    SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
    format( messagetext, 128, "[VIP]%s diz: %s", pname, text );
    SendPlayerMessageToAll( playerid, messagetext );
      }
return false;
}
Erros comente.
Reply
#3

Funfou legal , mais sу os vips q fala com esse code !
Reply
#4

ops kk

Caso alguйm tenha uma forma melhor de usar me fale й bom que eu aprendo
eu utilizo assim e funciona perfeitamente


OBS: vocк estб utilizando um Filter Script do Biel COP nгo se esqueзa de manter os devidos crйditos por favor.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(VIP[playerid] == 1)
    {
       
        new messagetext[128], pname[MAX_PLAYER_NAME];
        SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
        format( messagetext, 128, "[VIP]%s diz: %s", pname, text );
        SendPlayerMessageToAll( playerid, messagetext );
    }
    if(VIP[playerid] == 0)
    {
       
        new messagetext[128], pname[MAX_PLAYER_NAME];
        SetPlayerChatBubble(playerid, text, 0xFFFDE8AA, 100.0, 10000);
        format( messagetext, 128, "[ID: %i]%s diz: %s", playerid, pname, text );
        SendPlayerMessageToAll( playerid, messagetext );
    }
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)