[Ajuda] [13/2/2019] - MitsuK_WizzarD
#1

Olб Pessoal quem pode transformar esse comando de Admin, em comando de compra para todos os player, quero que os player de /comprarvip e /comprarsocio.

PHP Code:
    if(strcmp(cmd"/darsocio"true) == 0)
    {
          if(
IsPlayerConnected(playerid))
          {
               if(
JogadorInfo[playerid][pAdmin] < 1340)
               {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo tem autorizaзгo para usar esse comando.");
                    return 
1;
               }
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id] [Nivel] [dias]");
                    return 
1;
               }
               new 
para1;
               new 
level;
               
para1 ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id] [Nivel] [dias]");
                    return 
1;
               }
               
level strval(tmp);
               if(
level || level 5) { return 1; }
               
GetPlayerName(para1giveplayersizeof(giveplayer));
               
GetPlayerName(playeridsendernamesizeof(sendername));
               if(
IsPlayerConnected(para1))
               {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                         new 
length strlen(cmdtext);
                         while ((
idx length) && (cmdtext[idx] <= ' '))
                         {
                             
idx++;
                         }
                         new 
offset idx;
                         new 
result[64];
                         while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                         {
                             
result[idx offset] = cmdtext[idx];
                             
idx++;
                         }
                         
result[idx offset] = EOS;
                         if(!
strlen(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id] [Nivel] [dias]");
                              return 
1;
                         }
                         if(!
IsNumero(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /darsocio [id] [Nivel] [dias]");
                              return 
1;
                         }
                         
getdate(yearmonthday);
                         
gettime(hour,minute,second);
                         
SBizzInfo[5][sbTill] += 5000;
                         
ExtortionSBiz(55000);
                         
JogadorInfo[para1][pSocio] = level;
                         if(
level == && level == 4)
                         {
                              
JogadorInfo[para1][pVIP] = 3;
                         }
                         else
                         {
                              
JogadorInfo[para1][pVIP] = level;
                         }
                         if(
JogadorInfo[para1][pSocio] == 1)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Sуcio Bronze], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 2)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Sуcio Prata], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 3)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Sуcio Ouro], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 4)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Sуcio Platina], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 5)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Sуcio Diamante], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         if(
JogadorInfo[para1][pSocio] == 1)
                         {
                              
format(stringsizeof(string),"* Administrador: %s setou:[Sуcio Bronze] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 3;
                              
JogadorInfo[para1][pConta] += 300000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 2)
                         {
                              
format(stringsizeof(string),"* Administrador: %s setou:[Sуcio Prata] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 4;
                              
JogadorInfo[para1][pConta] += 400000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 3)
                         {
                              
format(stringsizeof(string),"* Administrador: %s setou:[Sуcio Ouro] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 5;
                              
JogadorInfo[para1][pConta] += 500000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 4)
                         {
                              
format(stringsizeof(string),"* Administrador: %s setou:[Sуcio Platina] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 8;
                              
JogadorInfo[para1][pConta] += 1000000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 5)
                         {
                              
format(stringsizeof(string),"* Administrador: %s setou:[Sуcio Diamante] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 12;
                              
JogadorInfo[para1][pConta] += 3000000;
                              
ScoreLevel(para1);
                         }
                         
format(stringsizeof(string), "%s deu Sуcio ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,daymonthyear,hourminute);
                         
SendClientMessage(playeridCOLOR_YELLOWstring);
                         
VipsLog(string);
                         
JogadorInfo[para1][pDiaVIP] = strval(result);
                         
OnPlayerSave(para1);
                         for(new 
0sizeof(VipInfo); i++)
                         {
                              if(
strcmp(PlayerName(para1),VipInfo[i][vNome],true)==0)
                              {
                                   if(
level 3)
                                   {
                                        
VipInfo[i][vTipo] = 3;
                                   }
                                   else
                                   {
                                        
VipInfo[i][vTipo] = level;
                                   }
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                              }
                              if(
strcmp("Ninguem",VipInfo[i][vNome],true)==0)
                              {
                                   
strmid(VipInfo[i][vNome], PlayerName(para1), 0strlen(PlayerName(para1)), 255);
                                   if(
level 3)
                                   {
                                        
VipInfo[i][vTipo] = 3;
                                   }
                                   else
                                   {
                                        
VipInfo[i][vTipo] = level;
                                   }
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                              }
                         }
                    }
               }
          }
          return 
1;
    }
    if(
strcmp(cmd"/darvip"true) == 0)
    {
          if(
IsPlayerConnected(playerid))
          {
               if(
JogadorInfo[playerid][pAdmin] < 1340)
               {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo tem autorizaзгo para usar esse comando.");
                    return 
1;
               }
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [Nivel] [dias]");
                    return 
1;
               }
               new 
para1;
               new 
level;
               
para1 ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [Nivel] [dias]");
                    return 
1;
               }
               
level strval(tmp);
               if(
level || level 3) { return 1; }
               
GetPlayerName(para1giveplayersizeof(giveplayer));
               
GetPlayerName(playeridsendernamesizeof(sendername));
               if(
IsPlayerConnected(para1))
               {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                         new 
length strlen(cmdtext);
                         while ((
idx length) && (cmdtext[idx] <= ' '))
                         {
                             
idx++;
                         }
                         new 
offset idx;
                         new 
result[64];
                         while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                         {
                             
result[idx offset] = cmdtext[idx];
                             
idx++;
                         }
                         
result[idx offset] = EOS;
                         if(!
strlen(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [Nivel] [dias]");
                              return 
1;
                         }
                         if(!
IsNumero(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [Nivel] [dias]");
                              return 
1;
                         }
                         
getdate(yearmonthday);
                         
gettime(hour,minute,second);
                         
SBizzInfo[5][sbTill] += 5000;
                         
ExtortionSBiz(55000);
                         
JogadorInfo[para1][pVIP] = level;
                         if(
JogadorInfo[para1][pVIP] == 1)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Vip Bronze], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         if(
JogadorInfo[para1][pVIP] == 2)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Vip Prata], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         if(
JogadorInfo[para1][pVIP] == 3)
                         {
                              
format(stringsizeof(string), "Vocк setou:[Vip Ouro], para %s, por:[%d] dias.",giveplayerstrval(result));
                              
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                         }
                         if(
JogadorInfo[para1][pVIP] == 1)
                         {
                              
format(stringsizeof(string), "* Administrador: %s setou:[Vip Bronze] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 2;
                              
JogadorInfo[para1][pConta] += 100000;
                              
ScoreLevel(para1);
                         }
                         if(
JogadorInfo[para1][pVIP] == 2)
                         {
                              
format(stringsizeof(string), "* Administrador: %s setou:[Vip Prata] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 3;
                              
JogadorInfo[para1][pConta] += 120000;
                              
ScoreLevel(para1);
                         }
                         if(
JogadorInfo[para1][pVIP] == 3)
                         {
                              
format(stringsizeof(string), "* Administrador: %s setou:[Vip Ouro] em vocк por:[%d] dias.",sendernamestrval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 4;
                              
JogadorInfo[para1][pConta] += 150000;
                              
ScoreLevel(para1);
                         }
                         
format(stringsizeof(string), "%s deu Vip ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,daymonthyear,hourminute);
                         
SendClientMessage(playeridCOLOR_YELLOWstring);
                         
VipsLog(string);
                         
JogadorInfo[para1][pDiaVIP] = strval(result);
                         
OnPlayerSave(para1);
                         for(new 
0sizeof(VipInfo); i++)
                         {
                              if(
strcmp(PlayerName(para1),VipInfo[i][vNome],true)==0)
                              {
                                   
VipInfo[i][vTipo] = level;
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                              }
                              if(
strcmp("Ninguem",VipInfo[i][vNome],true)==0)
                              {
                                   
strmid(VipInfo[i][vNome], PlayerName(para1), 0strlen(PlayerName(para1)), 255);
                                   
VipInfo[i][vTipo] = level;
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                               }
                         }
                    }
               }
          }
          return 
1;
    } 
Quando um player comprar um dos tipos.
Exemplo ele dar /comprarsocio escolhendo tipo de sуcio, E descontado dinheiro do seu RG, E aparecera uma mensagem para todos, Player tal, Copro sуcio tal, Por tal valor, Por 30 dias, E setando automaticamente 30 dias, do que ele compro. Caso o player nгo tenha dinheiro aparecera para ele, Vocк nгo tem dinheiro o suficiente, E assim nгo efetuando a compra.

Quem poder por favor.
Reply
#2

Remova alguns ifs, da uns ajuste e, vualб, vocк acaba de editar um cmd de uma gm da net
Reply
#3

OK agora como faзo para, Descontado dinheiro da sua conta do Banco quando comprar.
Se ele nгo tiver dinheiro suficiente aparecer uma mensagem para ele.
Reply
#4

Era bom se mandasse como vc definiu o Saldo

Exemplo:

PHP Code:
Player[playerid][Saldo
Vocк vк e troca. n vem postar undefined symbol nessa linha.

Basta fazer assim:

PHP Code:
if(Player[playerid][Saldo] < 10000)
    return 
SendClientMessage(playerid0xFF0000FF"| ERRO | Vocк nгo tem $10000 para comprar um VIP!");
Player[playerid][Saldo] =- 10000
10000 Seria o valor de 1 VIP
Reply
#5

Ok mas onde coloco esse cуdigo.

PHP Code:
    if(strcmp(cmd"/comprarsocio"true) == 0)
    {
          if(
IsPlayerConnected(playerid))
          {
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
                    return 
1;
               }
               new 
para1;
               new 
level;
               
para1 ReturnUser(tmp);
               
tmp strtok(cmdtextidx);
               if(!
strlen(tmp))
               {
                    
SendClientMessage(playeridCOLOR_GRAD2"USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
                    return 
1;
               }
               
level strval(tmp);
               if(
level || level 5) { return 1; }
               
GetPlayerName(para1giveplayersizeof(giveplayer));
               
GetPlayerName(playeridsendernamesizeof(sendername));
               if(
IsPlayerConnected(para1))
               {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                         new 
length strlen(cmdtext);
                         while ((
idx length) && (cmdtext[idx] <= ' '))
                         {
                             
idx++;
                         }
                         new 
offset idx;
                         new 
result[64];
                         while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                         {
                             
result[idx offset] = cmdtext[idx];
                             
idx++;
                         }
                         
result[idx offset] = EOS;
                         if(!
strlen(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Damante] [30]");
                              return 
1;
                         }
                         if(!
IsNumero(result))
                         {
                             
SendClientMessage(playeridCOLOR_GRAD2"USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
                              return 
1;
                         }
                         
getdate(yearmonthday);
                         
gettime(hour,minute,second);
                         
SBizzInfo[5][sbTill] += 5000;
                         
ExtortionSBiz(55000);
                         
JogadorInfo[para1][pSocio] = level;
                         if(
level == && level == 4)
                         {
                              
JogadorInfo[para1][pVIP] = 3;
                         }
                         else
                         if(
JogadorInfo[para1][pSocio] == 1)
                         {
                              
format(stringsizeof(string),"* Vocк compro [Sуcio Bronze] por [15 KK] por:[%d] dias."strval(result));//Administrador: %s setou:[Sуcio Bronze] em vocк por:[%d] dias.
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 3;
                              
JogadorInfo[para1][pConta] += 300000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 2)
                         {
                              
format(stringsizeof(string),"* Vocк compro [Sуcio Prata] por [20 KK] por:[%d] dias."strval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 4;
                              
JogadorInfo[para1][pConta] += 400000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 3)
                         {
                              
format(stringsizeof(string),"* Vocк compro [Sуcio Ouro] por [25 KK] por:[%d] dias."strval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 5;
                              
JogadorInfo[para1][pConta] += 500000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 4)
                         {
                              
format(stringsizeof(string),"* Vocк compro [Sуcio Platina] por [30 KK] por:[%d] dias."strval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 8;
                              
JogadorInfo[para1][pConta] += 1000000;
                              
ScoreLevel(para1);
                         }
                         else if(
JogadorInfo[para1][pSocio] == 5)
                         {
                              
format(stringsizeof(string),"* Vocк compro [Sуcio Diamante] por [50 KK] por:[%d] dias."strval(result));
                              
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                              
JogadorInfo[para1][pLevel] += 12;
                              
JogadorInfo[para1][pConta] += 3000000;
                              
ScoreLevel(para1);
                         }
                         
format(stringsizeof(string), "%s compro Sуcio nнvel %d (%d/%d/%d - %d:%d)",giveplayer,level,daymonthyear,hourminute);
                         
SendClientMessage(playeridCOLOR_YELLOWstring);
                         
VipsLog(string);
                         
JogadorInfo[para1][pDiaVIP] = strval(result);
                         
OnPlayerSave(para1);
                         for(new 
0sizeof(VipInfo); i++)
                         {
                              if(
strcmp(PlayerName(para1),VipInfo[i][vNome],true)==0)
                              {
                                   if(
level 3)
                                   {
                                        
VipInfo[i][vTipo] = 3;
                                   }
                                   else
                                   {
                                        
VipInfo[i][vTipo] = level;
                                   }
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                              }
                              if(
strcmp("Ninguem",VipInfo[i][vNome],true)==0)
                              {
                                   
strmid(VipInfo[i][vNome], PlayerName(para1), 0strlen(PlayerName(para1)), 255);
                                   if(
level 3)
                                   {
                                        
VipInfo[i][vTipo] = 3;
                                   }
                                   else
                                   {
                                        
VipInfo[i][vTipo] = level;
                                   }
                                   
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
                                   
SaveVip();
                                   break;
                              }
                         }
                    }
               }
          }
          return 
1;
    } 
Reply
#6



Na public de comandos.
Reply
#7

O AutoMatic2 esse aqui colo onde. E entre meu codigo.
PHP Code:
if(Player[playerid][Saldo] < 10000
    return 
SendClientMessage(playerid0xFF0000FF"| ERRO | Vocк nгo tem $10000 para comprar um VIP!"); 
Player[playerid][Saldo] =- 10000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)