SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 13/02/2019, 10:42 AM   #1
Mitsukwizzard
Little Clucker
 
Join Date: Jan 2019
Posts: 17
Reputation: 0
Default [13/2/2019] - MitsuK_WizzarD

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.
Mitsukwizzard is offline   Reply With Quote
Old 13/02/2019, 11:34 AM   #2
Felipealves
Huge Clucker
 
Felipealves's Avatar
 
Join Date: Mar 2016
Location: Paraná
Posts: 356
Reputation: 16
Default Re: [13/2/2019] - MitsuK_WizzarD

Remova alguns ifs, da uns ajuste e, vualá, você acaba de editar um cmd de uma gm da net
__________________
Felipealves is offline   Reply With Quote
Old 13/02/2019, 04:00 PM   #3
Mitsukwizzard
Little Clucker
 
Join Date: Jan 2019
Posts: 17
Reputation: 0
Default Re: [13/2/2019] - MitsuK_WizzarD

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.
Mitsukwizzard is offline   Reply With Quote
Old 13/02/2019, 04:08 PM   #4
AutoMatic2
Huge Clucker
 
AutoMatic2's Avatar
 
Join Date: Apr 2018
Location: Patrocínio MG
Posts: 432
Reputation: 10
Default Re: [13/2/2019] - MitsuK_WizzarD

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
AutoMatic2 is offline   Reply With Quote
Old 13/02/2019, 04:40 PM   #5
Mitsukwizzard
Little Clucker
 
Join Date: Jan 2019
Posts: 17
Reputation: 0
Default Re: [13/2/2019] - MitsuK_WizzarD

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;
    } 
Mitsukwizzard is offline   Reply With Quote
Old 13/02/2019, 06:05 PM   #6
AutoMatic2
Huge Clucker
 
AutoMatic2's Avatar
 
Join Date: Apr 2018
Location: Patrocínio MG
Posts: 432
Reputation: 10
Default Re: [13/2/2019] - MitsuK_WizzarD



Na public de comandos.
AutoMatic2 is offline   Reply With Quote
Old 14/02/2019, 10:17 AM   #7
Mitsukwizzard
Little Clucker
 
Join Date: Jan 2019
Posts: 17
Reputation: 0
Default Re: [13/2/2019] - MitsuK_WizzarD

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
Mitsukwizzard is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kam's Max Script for 3ds max 2019 XDamienX007 Everything and Nothing 1 02/07/2019 06:51 PM
[Map] All of my mapps 40+[2017/2019] PetritImeri Maps 7 11/06/2019 02:07 AM
Happy New Year! 2019 Hazon Everything and Nothing 31 19/01/2019 05:28 AM


All times are GMT. The time now is 10:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.