[Ajuda] /rg
#1

Faz um tempinho atras que estou com esse probleminha,exemplo,dou socio para o player no /rg aparece que a conta dele й socio,mas se sou vip aparece conta gratis.

Код:
new drank[16];
		if(PlayerInfo[targetid][pVIP] == 0 || PlayerInfo[targetid][pSocio] == 0) { drank = "Gratis"; }
		else if(PlayerInfo[targetid][pVIP] == 1) { drank = "Vip Bronze"; }
		else if(PlayerInfo[targetid][pVIP] == 2) { drank = "Vip Prata"; }
		else if(PlayerInfo[targetid][pVIP] == 3) { drank = "Vнp Ouro"; }
		else if(PlayerInfo[targetid][pSocio] == 1) { drank = "Sуcio Bronze"; }
		else if(PlayerInfo[targetid][pSocio] == 2) { drank = "Sуcio Prata"; }
		else if(PlayerInfo[targetid][pSocio] == 3) { drank = "Sуcio Ouro"; }
		else if(PlayerInfo[targetid][pSocio] == 4) { drank = "Sуcio Diamante"; }
Reply
#2

PHP код:
new vip[16];
new 
socio[16];
if( 
PlayerInfo[targetid][pVIP] == )
    
vip "Grбtis";
else if (
PlayerInfo[targetid][pVIP] == 1)
    
vip "Vip Bronze";
else if(
PlayerInfo[targetid][pVIP] == 2)
    
vip "Vip Prata";
else if( 
PlayerInfo[targetid][pVIP] == 3)
    
vip "Vнp Ouro";
if(
PlayerInfo[targetid][pSocio] == 0)
    
socio "Grбtis";
else if(
PlayerInfo[targetid][pSocio] == 1)
    
socio "Sуcio Bronze";
else if(
PlayerInfo[targetid][pSocio] == 2)
    
socio "Sуcio Prata";
else if(
PlayerInfo[targetid][pSocio] == 3)
    
socio "Sуcio Ouro";
else if(
PlayerInfo[targetid][pSocio] == 4)
    
socio "Sуcio Diamante";
    
new 
str[36];
format(strsizeof str"VIP: %s - Sуcio: %s"vipsocio);
SendClientMessage(playerid, -1str); 
Recomendo usar:
https://sampwiki.blast.hk/wiki/Control_Structures#switch

Ao meu ver ficaria melhor assim:
PHP код:
new drank[16];
switch ( 
PlayerInfo[targetid][pVIP] )
{
    case 
0drank "Grбtis";
    case 
1drank "Vip Bronze";
    case 
2drank "Vip Prata";
    case 
3drank "Vнp Ouro";
    case 
4drank "Sуcio Bronze";
    case 
5drank "Sуcio Prata";
    case 
6drank "Sуcio Ouro";
    case 
7drank "Sуcio Diamante";
    default: 
drank "Grбtis";

Caso seja assim terбs de adaptar seu GM.

Beijos!
Reply
#3

Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
PHP код:
new vip[16];
new 
socio[16];
if( 
PlayerInfo[targetid][pVIP] == )
    
vip "Grбtis";
else if (
PlayerInfo[targetid][pVIP] == 1)
    
vip "Vip Bronze";
else if(
PlayerInfo[targetid][pVIP] == 2)
    
vip "Vip Prata";
else if( 
PlayerInfo[targetid][pVIP] == 3)
    
vip "Vнp Ouro";
if(
PlayerInfo[targetid][pSocio] == 0)
    
socio "Grбtis";
else if(
PlayerInfo[targetid][pSocio] == 1)
    
socio "Sуcio Bronze";
else if(
PlayerInfo[targetid][pSocio] == 2)
    
socio "Sуcio Prata";
else if(
PlayerInfo[targetid][pSocio] == 3)
    
socio "Sуcio Ouro";
else if(
PlayerInfo[targetid][pSocio] == 4)
    
socio "Sуcio Diamante";
    
new 
str[36];
format(strsizeof str"VIP: %s - Sуcio: %s"vipsocio);
SendClientMessage(playerid, -1str); 
Recomendo usar:
https://sampwiki.blast.hk/wiki/Control_Structures#switch

Ao meu ver ficaria melhor assim:
PHP код:
new drank[16];
switch ( 
PlayerInfo[targetid][pVIP] )
{
    case 
0drank "Grбtis";
    case 
1drank "Vip Bronze";
    case 
2drank "Vip Prata";
    case 
3drank "Vнp Ouro";
    case 
4drank "Sуcio Bronze";
    case 
5drank "Sуcio Prata";
    case 
6drank "Sуcio Ouro";
    case 
7drank "Sуcio Diamante";
    default: 
drank "Grбtis";

Caso seja assim terбs de adaptar seu GM.

Beijos!
Obrigado pela sua ajuda,mas ainda nгo consegui resolver o erro.
Reply
#4

Provavelmente nгo esta setando os Rankings do vip, ou nгo esta chamando no /rg dб forma correta.
Reply
#5

Quote:
Originally Posted by Wanderson_SAMP
Посмотреть сообщение
Provavelmente nгo esta setando os Rankings do vip, ou nгo esta chamando no /rg dб forma correta.
Estava pensando o mesmo,ai dei uma verificada e percebi que nгo й isso
Reply
#6

Posta o comando de dar vip/socio e o /rg tambem por favor.
Reply
#7

PHP код:
   
stock IsPlayerVIP
(playerid)
{
    new 
vip[40];
    if(
PlayerInfo[targetid][pVIP] < )  vip "Grбtis";
    else if(
PlayerInfo[targetid][pVIP] >= && PlayerInfo[targetid][pVIP] < 2vip "VIP Bronze";
    else if(
PlayerInfo[targetid][pVIP] >= && PlayerInfo[targetid][pVIP] < 3vip "VIP Prata";
    else if(
PlayerInfo[targetid][pVIP] >= vip "VIP Ouro";
    return 
vip;
}
stock IsPlayerSocio(playerid)
{
    new 
socio[40];
    if(
PlayerInfo[targetid][pSocio] < )  socio "Grбtis";
    else if(
PlayerInfo[targetid][pSocio] >= && PlayerInfo[targetid][pSocio] < 2sуcio "Sуcio Bronze";
    else if(
PlayerInfo[targetid][pSocio] >= && PlayerInfo[targetid][pSocio] < 3sуcio "Sуcio Prata";
    else if(
PlayerInfo[targetid][pSocio] >= && PlayerInfo[targetid][pSocio] < 4socio "Sуcio Ouro";
    else if(
PlayerInfo[targetid][pSocio] >= socio "Sуcio Diamante";
    return 
socio;

//No seu comando /RG
IsPlayerVIP(playerid)
IsPlayerSocio(playerid
Reply
#8

Manda o comando do rg. O erro nгo tб nesse code ai.
Reply
#9

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
Manda o comando do rg. O erro nгo tб nesse code ai.
" == " significa igualdade.

if(PlayerInfo[targetid][pVIP] == 0 || PlayerInfo[targetid][pSocio] == 0) { drank = "Gratis"; }
(pVIP == 0) vai ser Grбtis, o resto nгo vai ser absolutamente nada.

Clique aqui
Reply
#10

Quote:

format(gstring, sizeof(gstring), "Level[%d] Sexo[%s] Conta[%s] Dinheiro[%d] Banco[%d] Casamento[%s] Horas Jogadas[%d] Cidade[%s]",level, atext,drank, cash, Conta, married, ptime,cidtext);
SendClientMessage(playerid, COR_RG,gstring);

Drank й a parte que ele define que tipo de conta й..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)