03.12.2018, 20:04
Quote:
PHP Code:
PHP Code:
PHP Code:
|
ele trocou a cor do player nгo a Tag vip
PHP Code:
ShowPlayerDialog(playerid, CorVip , 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(playerid, 0xff0000ff, "* Vocк precisa digitar um cуdigo hex vбlido!");
String[0] = EOS;
format(String, sizeof(String), "%s", inputtext), SetPlayerColor(playerid, HexToInt(String));
return SendClientMessage(playerid, HexToInt(String), "Vocк setou sua cor!");
}
return true;
}
stock isValidHexCode(code[])
{
new checked;
for(new i; i < strlen(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 = 1, res = 0;
for(new i = strlen(string); i > 0; i--)
{
res += cur * (string[i - 1] - ((string[i - 1] < 58) ? (48) : (55)));
cur = cur * 16;
}
return res;
}
PHP Code:
if(PlayerInfo[playerid][pCor2] == 1){
format(string,sizeof(string),"%s{FFFFFF}: [%d:{00FF00}VIP{FFFFFF}]: %s",Nome(playerid),playerid,text);
ProxDetector(30.0, playerid, string, GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid));
return 0;
}