[Ajuda] comando /comprarvip
#1

Olá, meu comando /comprarvip está bugado, tipo, um vip é 4000 cash, mesmo ele sem ter os cash e digitar o comando ele pega todos os direitos do vip e quando ele reloga, a conta dele volta a ser Free. Mas isso só acontece quando ele realmente não tem os cash na conta.
Sou novato nisso e ainda não sei resolver erros desse tipo.

PHP код:
    if(strcmp(cmd"/comprarvip"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pVIP] >= 1)
            {
                
SendClientMessage(playeridCOLOR_WHITE"Você já possui um VIP ativo.");
                return 
1;
            }
            
VipVaga();
            if(
VagaSobrando == 0)
            {
                
SendClientMessage(playeridCOLOR_WHITE"Não possui mais vagas de VIP.");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_WHITE"Use /comprarvip [1-3].");
                
SendClientMessage(playeridCOLOR_WHITE"1= VIP, 1000 cash. {FFFF00}2= VIP PREMUIM, 2500 cash. {0000FF}3= VIP SÓCIO, 4000 cash");
                return 
1;
            }
            new 
level;
            
level strval(tmp);
            {
                {
                    
getdate(yearmonthday);
                    
gettime(hour,minute,second);
                    
PlayerInfo[playerid][pVIP] = level;
                    new 
var03 0;
                    new 
Anov,Mesv,Diav,Horav,Minutov,SegV;
                    
getdate(AnovMesvDiav);
                    
gettime(HoravMinutovSegV);
                    if(
Mesv == 12 && Anov == 2012) { Mesv 1Anov++;} else { Mesv++; }
                    if(
level == 1)
                    {
                        if (
PlayerInfo[playerid][tCash] < 1000)
                        {
                            
SendClientMessage(playeridCOLOR_WHITE"Você não possui '1000' de CASH.");
                            return 
1;
                        }
                        else
                        {
                            new 
VipNivel 1;
                            new 
VipGrana 1000000;
                            
PlayerInfo[playerid][tCash] -= 1000;
                            
PlayerPlaySound(playerid10840.00.00.0);
                            
SendClientMessage(playeridCOLOR_WHITE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*{FFFF00}[Liberação do VIP]{FFFFFF}*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*");
                            
PlayerInfo[playerid][pConta] += VipGrana;
                            
PlayerInfo[playerid][pLevel] += VipNivel;
                            
format(stringsizeof string"- Você ativou seu VIP nível: {FFFF00}%d"level);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                            
format(gstringsizeof(gstring), "- Você recebeu {00FF00}%dR$ {FFFFFF}em sua conta bancária."VipGrana);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "- Você recebeu mais {FFFF00}%d {FFFFFF}de nível em seu personagem."VipNivel);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "* VENCIMENTO DO VIP: {FFFF00}%d/%d/%d, {FFFFFF}HORA: {FFFF00}%d:%d:%d."Diav,Mesv,Anov,Horav,Minutov,SegV);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*");
                        }
                    }
                    else if(
level == 2)
                    {
                        if (
PlayerInfo[playerid][tCash] < 2500)
                        {
                            
SendClientMessage(playeridCOLOR_WHITE"Você não possui '2500' de CASH.");
                            return 
1;
                        }
                        else
                        {
                            new 
VipGrana 2500000;
                            new 
VipNivel 2;
                            
PlayerInfo[playerid][tCash] -= 2500;
                            
PlayerPlaySound(playerid10840.00.00.0);
                            
SendClientMessage(playeridCOLOR_WHITE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*{FFFF00}[Liberação do VIP]{FFFFFF}*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*");
                            
PlayerInfo[playerid][pConta] += VipGrana;
                            
PlayerInfo[playerid][pLevel] += VipNivel;
                            
format(stringsizeof string"- Você ativou seu VIP nível: {FFFF00}%d"level);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                            
format(gstringsizeof(gstring), "- Você recebeu {00FF00}%dR$ {FFFFFF}em sua conta bancária."VipGrana);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "- Você recebeu mais {FFFF00}%d {FFFFFF}de nível em seu personagem."VipNivel);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "* VENCIMENTO DO VIP: {FFFF00}%d/%d/%d, {FFFFFF}HORA: {FFFF00}%d:%d:%d."Diav,Mesv,Anov,Horav,Minutov,SegV);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*");
                        }
                    }
                    else if(
level == 3)
                    {
                        if (
PlayerInfo[playerid][tCash] < 4000)
                        {
                            
SendClientMessage(playeridCOLOR_WHITE"Você não possui '4000' de CASH.");
                            return 
1;
                        }
                        else
                        {
                            new 
VipGrana 3500000;
                            new 
VipNivel 3;
                            
PlayerInfo[playerid][tCash] -= 4000;
                            
PlayerPlaySound(playerid10840.00.00.0);
                            
SendClientMessage(playeridCOLOR_WHITE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*{FFFF00}[Liberação do VIP]{FFFFFF}*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*");
                            
PlayerInfo[playerid][pConta] += VipGrana;
                            
PlayerInfo[playerid][pLevel] += VipNivel;
                            
format(stringsizeof string"- Você ativou seu VIP nível: {FFFF00}%d"level);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                            
format(gstringsizeof(gstring), "- Você recebeu {00FF00}%dR$ {FFFFFF}em sua conta bancária."VipGrana);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "- Você recebeu mais {FFFF00}%d {FFFFFF}de nível em seu personagem."VipNivel);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
format(gstringsizeof(gstring), "* VENCIMENTO DO VIP: {FFFF00}%d/%d/%d, {FFFFFF}HORA: {FFFF00}%d:%d:%d."Diav,Mesv,Anov,Horav,Minutov,SegV);
                            
SendClientMessage(playeridCOLOR_WHITEgstring);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*~~*~~*~~*~~**~~*~~*~~*~~*~~*~~*");
                        }
                    }
                    
ScoreLevel(playerid);
                    for(new 
0sizeof(VipInfo); i++)
                    {
                        if(
strcmp(PlayerName(playerid),VipInfo[i][vNick],true)==0)
                        {
                            
VipInfo[i][vDia] = Diav;
                            
VipInfo[i][vMes] = Mesv;
                            
VipInfo[i][vAno] = Anov;
                            
VipInfo[i][vHora] = Horav;
                            
VipInfo[i][vMinuto] = Minutov;
                            
VipInfo[i][vSegundo] = SegV;
                            
SaveVip();
                            
var03 1;
                            break;
                        }
                    }
                    if(
var03 == 0)
                    {
                        for(new 
0sizeof(VipInfo); i++)
                        {
                            if(
strcmp("Ninguem",VipInfo[i][vNick],true)==0)
                            {
                                
strmid(VipInfo[i][vNick], PlayerName(playerid), 0strlen(PlayerName(playerid)), 255);
                                
VipInfo[i][vDia] = Diav;
                                
VipInfo[i][vMes] = Mesv;
                                
VipInfo[i][vAno] = Anov;
                                
VipInfo[i][vHora] = Horav;
                                
VipInfo[i][vMinuto] = Minutov;
                                
VipInfo[i][vSegundo] = SegV;
                                break;
                            }
                        }
                    }
                    
SalvarPlayer(playerid);
                    
SaveVip();
                }
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
comando /comprarvip - by gilvanmarques - 07.07.2017, 00:30
Re: comando /comprarvip - by Jonorusc - 08.07.2017, 16:49
Re: comando /comprarvip - by gilvanmarques - 08.07.2017, 17:55
Re: comando /comprarvip - by Jonorusc - 08.07.2017, 18:02
Re: comando /comprarvip - by gilvanmarques - 08.07.2017, 21:11
Re: comando /comprarvip - by Jonorusc - 08.07.2017, 21:30

Forum Jump:


Users browsing this thread: 1 Guest(s)