[Ajuda] PayDay!
#1

Pessoal й urgente e rбpido, estou aqui com um sistema de payday em geral, tipo, eu queria que contasse cada jogador online, exemplo..

aqui se o player for level menor que 5 ele ganha dinheiro, mais do jeito que estб aqui em baixo

pawn Код:
if(PlayerInfo[i][pLevel] < 5)
                    {
                        new pNivel = PlayerInfo[i][pLevel];
                        new ADC = pNivel/70;
                        format(string, sizeof(string), "Dinheiro para novatos: +$%d", ADC);
                        SendClientMessage(i, 0xFFFFFFFF, string);
                        PlayerInfo[i][pAccount] += ADC;
                        SacarGranaOrg(7, ADC);
                    }
vai sacar sу uma vez do player o valor ADC, eu queria sacar a quantia ADC contando todos os players novatos, ou seja, caso tenha 20 novatos, retirar do cofre 20 vezes o ADC e etc.. caso alguйm entenda bem me ajudar pf?

tenho isso

pawn Код:
forward ContarJogadores();
public ContarJogadores(){
new Jogadores = 0;
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i) && !IsPlayerNPC(i)){Jogadores++;}}return Jogadores;}
up, +rep garantida!
Reply
#2

Pra contar todos os novatos a variбvel "ADC" precisa ser global e alterada a cada payday, entгo faz assim:

Topo do GM:
Quote:

new NewbiePlayers;

Agora no topo da funзгo/public de payday:

Quote:

exemplo:

public PayDay()
{
CountNewbiePlayers();
//aqui vai o resto da public
}

Adcione no gm:
Quote:

CountNewbiePlayers()
{
for(new p; p < MAX_PLAYERS; p++)
{
if(PlayerInfo[i][pLevel] < 5) NewbiePlayers++;
}
}

Agora substitua no seu sistema essa parte:

Quote:

PlayerInfo[i][pAccount] += ADC * NewbiePlayers;
SacarGranaOrg(7, ADC * NewbiePlayers);

Nгo testei e minha conexгo estб muito lenta, caso alguйm veja algum erro ou melhora no cуdigo por favor me corrija ai...
Reply
#3

Tipo, eu ia criar um outro tуpico, mais vou aproveitar esse, tipo n0minal meu cуdigo tб assim..

tб certo?
pawn Код:
if(PlayerInfo[i][pLevel] < 5) // https://sampforum.blast.hk/showthread.php?tid=549128
                    {
                        new Lucro2, Juros2;
                        Lucro2 = PlayerInfo[i][pAccount] * 7 / 100;
                        Juros2 = (PlayerInfo[i][pAccount] / 90) * (Lucro2);
                        PlayerInfo[i][pAccount] = account + Juros2;
                        format(string, sizeof(string), "Ajuda de Custo: +$%d", Juros2);
                        SendClientMessage(i, 0xFFFFFFFF, string);
                        PlayerInfo[i][pAccount] += Juros2;
                        SacarGranaOrg(7, Juros2 * NewbiePlayers);
                    }
e outra eu quero mudar isso:

Quote:

new Lucro, Juros;
Lucro = PlayerInfo[i][pAccount] * 7 / 100;
Juros = (PlayerInfo[i][pAccount] / 90) * (Lucro);

pq os juros ganho ..

Quote:

format(string, sizeof(string), "Juros ganho: +$%d", Juros);
SendClientMessage(i, 0xFFFFFFFF, string);

fica muito $$, tem que ser menos, tipo alguйm pode me ajudar a deixar de uma formar Rp(Roleplay) moeda americana? pois deste modo ae a pessoa ganha grana pra caraiow! alguem pf? +rep!

Tipo eu quero deixa isso ae mais real mais dentro da vida real, com dinheiro $$
Reply
#4

Quote:
Originally Posted by JoshNudock
Посмотреть сообщение
Tipo, eu ia criar um outro tуpico, mais vou aproveitar esse, tipo n0minal meu cуdigo tб assim..

tб certo?
pawn Код:
if(PlayerInfo[i][pLevel] < 5) // https://sampforum.blast.hk/showthread.php?tid=549128
                    {
                        new Lucro2, Juros2;
                        Lucro2 = PlayerInfo[i][pAccount] * 7 / 100;
                        Juros2 = (PlayerInfo[i][pAccount] / 90) * (Lucro2);
                        PlayerInfo[i][pAccount] = account + Juros2;
                        format(string, sizeof(string), "Ajuda de Custo: +$%d", Juros2);
                        SendClientMessage(i, 0xFFFFFFFF, string);
                        PlayerInfo[i][pAccount] += Juros2;
                        SacarGranaOrg(7, Juros2 * NewbiePlayers);
                    }
e outra eu quero mudar isso:



pq os juros ganho ..



fica muito $$, tem que ser menos, tipo alguйm pode me ajudar a deixar de uma formar Rp(Roleplay) moeda americana? pois deste modo ae a pessoa ganha grana pra caraiow! alguem pf? +rep!
Alguem pf? UP!!!
Reply
#5

Dб uma lida ai amigгo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)