[Pedido] Sistemas de cores VIP.
#3

Quote:
Originally Posted by NelsonC
View Post
PHP Code:
if(dialogid == sua_dialog):
        {
            if(
response)
            {
                if(
strlen(inputtext) != strlen("FFFFFF") || isnull(inputtext) || !isValidHexCode(inputtext))
                    return 
SendClientMessage(playerid0xff0000ff"* Vocк precisa digitar um cуdigo hex vбlido!");
                
String[0] = EOS;
                
format(Stringsizeof(String), "0x%sFF"inputtext), SetPlayerColor(playeridHexToInt(String));
                return 
SendClientMessage(playeridHexToInt(String), "Vocк setou sua cor!");
            }
            return 
true;
        } 

PHP Code:
stock isValidHexCode(code[])
{
    new 
checked;
    for(new 
istrlen(code); i++)
    {
        if(
code[i] >= '0' && code[i] <= '9')
            
checked+=1;
        else if((
code[i] == 'A' || code[i] == 'a') || (code[i] == 'B' || code[i] == 'b') || (code[i] == 'C' || code[i] == 'c') || (code[i] == 'D' || code[i] == 'd') || (code[i] == 'E' || code[i] == 'e') || (code[i] == 'F' || code[i] == 'f'))
            
checked+=1;
    }
    if(
checked == 6)
        return 
true;
    return 
false;

PHP Code:
stock HexToInt(string[])
{
    if(!
string[0]) return 0;
    new 
cur 1res 0;
    for(new 
strlen(string); 0i--)
    {
        
res += cur * (string[1] - ((string[1] < 58) ? (48) : (55)));
        
cur cur 16;
    }
    return 
res;

eu uso assim, agr adapte no seu servidor.
Nгo deu certo nгo manin.
ele trocou a cor do player nгo a Tag vip


PHP Code:
ShowPlayerDialog(playeridCorVip DIALOG_STYLE_INPUT"{33ff33}Tag Vip""{FFFFFF}Digite abaixo um cуdigo para mudar a cor da tag vip\n{FFFFFF}Pesquise no ****** como {31B404}Cуdigos de Cores HTML\n{FF0000}Exemplo: {FFFFFF}Cуdigo 31B404 = [{31B404}VIP{FFFFFF}] FF8000 = [{FF8000}VIP{FFFFFF}]""Alterar""Cancelar");
if(
dialogid == sua_dialog):
    {
         if(
response)
        {
         if(
strlen(inputtext) != strlen("FFFFFF") || isnull(inputtext) || !isValidHexCode(inputtext))
        return 
SendClientMessage(playerid0xff0000ff"* Vocк precisa digitar um cуdigo hex vбlido!");
        
String[0] = EOS;
        
format(Stringsizeof(String), "%s"inputtext), SetPlayerColor(playeridHexToInt(String));
        return 
SendClientMessage(playeridHexToInt(String), "Vocк setou sua cor!");
    }
    return 
true;
}
stock isValidHexCode(code[])
{
    new 
checked;
    for(new 
istrlen(code); i++)
    {
        if(
code[i] >= '0' && code[i] <= '9')
            
checked+=1;
        else if((
code[i] == 'A' || code[i] == 'a') || (code[i] == 'B' || code[i] == 'b') || (code[i] == 'C' || code[i] == 'c') || (code[i] == 'D' || code[i] == 'd') || (code[i] == 'E' || code[i] == 'e') || (code[i] == 'F' || code[i] == 'f'))
            
checked+=1;
    }
    if(
checked == 6)
        return 
true;
    return 
false;
}
stock HexToInt(string[])
{
    if(!
string[0]) return 0;
    new 
cur 1res 0;
    for(new 
strlen(string); 0i--)
    {
        
res += cur * (string[1] - ((string[1] < 58) ? (48) : (55)));
        
cur cur 16;
    }
    return 
res;

Queria que ele coloca-se a cor nova nessa funзгo:
PHP Code:
 if(PlayerInfo[playerid][pCor2] == 1){
       
format(string,sizeof(string),"%s{FFFFFF}: [%d:{00FF00}VIP{FFFFFF}]: %s",Nome(playerid),playerid,text);
       
ProxDetector(30.0playeridstringGetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid));
       return 
0;
    } 
Reply


Messages In This Thread
Sistemas de cores VIP. - by DeusGrego - 03.12.2018, 18:56
Re: Sistemas de cores VIP. - by NelsonC - 03.12.2018, 19:03
Re: Sistemas de cores VIP. - by DeusGrego - 03.12.2018, 20:04
Re: Sistemas de cores VIP. - by Luiiiz - 03.12.2018, 20:33
Re: Sistemas de cores VIP. - by ipsLuan - 03.12.2018, 20:36
Re: Sistemas de cores VIP. - by DeusGrego - 04.12.2018, 06:13

Forum Jump:


Users browsing this thread: 1 Guest(s)