[Ajuda] Mudar Comando
#1

Olб pessoal, estou aqui com um comando de prefeito, й tipo como se fosse bolsa famнlia, mas ele da uma taxa somente para os policiais online, e eu queria que o dinheiro fosse para todos os players online para ser um bolsa famнlia, e eu ja tentei tirar as variбveis COP do code, mas fica dando error, poderia me ajudar?

Cуdigo:

Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pLider] != 7)
	        {
				SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
				return true;
	        }
	        if(Tax < 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nгo hб Dinheiro suficiente no banco de Impostos !");
				return true;
			}
			new Cops = 0;
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
			    if(IsPlayerConnected(i))
			    {
			        if(IsACop(i))
			        {
			            Cops += 1;
			        }
			    }
			}
			if(Cops >= 1)
			{
			    new price = Tax / Cops;
			    for(new i = 0; i < MAX_PLAYERS; i++)
				{
				    if(IsPlayerConnected(i))
				    {
				        if(IsACop(i))
				        {
				            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os policiais online!");
				            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
							SendClientMessage(i, COLOR_LIGHTBLUE, string);
							GivePlayerMoney(i, price);
							Tax = 0;
				        }
				    }
				}
				SaveStuff();
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "  Nгo hб nenhum Policial Online no Momento !");
				return true;
			}
		}
		return true;
	}
Lembrando que para nгo ir para os policiais nгo pode ter a variбvel COP, me ajudem por favor :/
Reply
#2

Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
 if(strval(params) < 0 || strval(params) > 9999999) return SendClientMessage(playerid, -1, "[ERRO] QuantiaInvбlida.");
        if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pLider] != 7)
	        {
				SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
				return true;
	        }
			if(IsPlayerConnected(i))
			{
			    for (new i = 0; i < MAX_PLAYERS; i++)
				{
				            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
				            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
					    SendClientMessage(i, COLOR_LIGHTBLUE, string);
					    GivePlayerMoney(i, strval(params));
				        }
				    }
				SaveStuff();
			}
		}
		return true;
	}
Nгo testei. Tenta.
Reply
#3

Skull, seu cуdigo vai dar erros.

pawn Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
                                  if(strval(params) < 0 || strval(params) > 9999999) return SendClientMessage(playerid, -1, " [ERRO] Quantia Invбlida.");
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLider] != 7)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
                return true;
            }
            if(IsPlayerConnected(i))
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
                            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                             GivePlayerMoney(l, strval(params));
                }
            }
                SaveStuff();
        }      
        return true;
    }
Reply
#4

Nгo й assim, era tipo igual ao anterior, mнnimo de players online 15, e tem que ser o que tem dentro do impostфmetro dividido pelo nъmero de pessoas online.
Tipo assim:

Код:
new bolsa = Tax/(aqui nгo sei o que coloca, mas й Tax dividido pelo nъmero de jogadores online);
SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os jogadores online!");
format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",bolsa);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
GivePlayerMoney(i, bolsa);
entendeu?
Reply
#5

Quote:
Originally Posted by Coe1
Посмотреть сообщение
Skull, seu cуdigo vai dar erros.

pawn Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
                                  if(strval(params) < 0 || strval(params) > 9999999) return SendClientMessage(playerid, -1, " [ERRO] Quantia Invбlida.");
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLider] != 7)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
                return true;
            }
            if(IsPlayerConnected(i))
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
                            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                             GivePlayerMoney(l, strval(params));
                }
            }
                SaveStuff();
        }      
        return true;
    }
O seu tambйm , kkk .

o l nгo ta definido :
Код:
GivePlayerMoney(l, strval(params));
New code :
pawn Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLider] != 7)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
                return true;
            }
            if(IsPlayerConnected(i))
            {
                            new price = Tax / Cops;
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
                            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                             GivePlayerMoney(i,price);
                }
            }
                SaveStuff();
        }      
        return true;
    }
Reply
#6

Eu nem vi isso. AEHUAEHAE

Peguei do cуdigo dele lб. O seu tinha uma chave aberta. u.u
Reply
#7

Quote:
Originally Posted by lokos45
Посмотреть сообщение
Nгo й assim, era tipo igual ao anterior, mнnimo de players online 15, e tem que ser o que tem dentro do impostфmetro dividido pelo nъmero de pessoas online.
Tipo assim:

Код:
new bolsa = Tax/(aqui nгo sei o que coloca, mas й Tax dividido pelo nъmero de jogadores online);
SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os jogadores online!");
format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",bolsa);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
GivePlayerMoney(i, bolsa);
entendeu?
PHP код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pLider] != 7)
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й o Prefeito !");
                return 
true;
            }
            if(
IsPlayerConnected(i))
            {
                new 
price Tax Cops;
                for(new 
0MAX_PLAYERSi++)
                {
                            
SendClientMessage(playeridCOLOR_GREY"Vocк deu a taxa para todos os players!");
                            
format(stringsizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            
SendClientMessage(iCOLOR_LIGHTBLUEstring);
                             
GivePlayerMoney(i,price);
                }
            }
                
SaveStuff();
        }       
        return 
true;
    } 
Reply
#8

Foi, mas ele ta dando para atй quando tem 1 player online, tem que ser no mнnimo 15...
Reply
#9

Eu ia ajudar mais, sу que jб tinha gente ajudando u-u.

pawn Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLider] != 7)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
                return true;
            }
           if(ContarJogadores >= 15)
          {
              if(IsPlayerConnected(i))
              {
                new price = Tax / Cops;
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
                            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                             GivePlayerMoney(i,price);
                }
            }
                SaveStuff();
        }      
        return true;
    }
Reply
#10

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
Eu ia ajudar mais, sу que jб tinha gente ajudando u-u.

pawn Код:
if(strcmp(cmd,"/dartaxa",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLider] != 7)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й o Prefeito !");
                return true;
            }
           if(ContarJogadores >= 15)
          {
              if(IsPlayerConnected(i))
              {
                new price = Tax / Cops;
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                            SendClientMessage(playerid, COLOR_GREY, "Vocк deu a taxa para todos os players!");
                            format(string, sizeof(string), "* Vocк recebeu R$%d do banco de Impostos pelo Prefeito.",price);
                            SendClientMessage(i, COLOR_LIGHTBLUE, string);
                             GivePlayerMoney(i,price);
                }
            }
                SaveStuff();
        }      
        return true;
    }
ai Coloca new ContarJogadores = ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)