Help me fix this please.
#1

Well I'm having a prob with my payday. Seems as if the :/signcheck: message is only showing up when we have a max of 5 people, once we have 15 people, the server wouldn't give paychecks anymore, can somebody figure out my problem.
Reply
#2

Sure. I'm going to sense your script is being a fag and doesn't like you. Dude... We can't help if you don't post code!
Reply
#3

Well make sure your MAX_PLAYERS if your using that on the payday and shit is defined for all the players in your script example. If you have a 29 slot server, then it would be like

#define MAX_PLAYERS 29

Idk if im 100% correct since i never use that define and stuff. But please just show the code would help out AAAAAAAALLLLLLLLOOOOOOOOTTTTTTT(sorry having a little fun there)
Reply
#4

Okay here

pawn Код:
public PayDay()
{
    new string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            Points[i][Announced] = 0;
            if (Points[i][Vulnerable] > 0)
            {
                Points[i][Vulnerable]--;
                UpdatePoints();
            }
        }
    }
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayerInfo[i][pCheck] = 1;
            CheckNumber[i] = 1000+random(8999);
            format(string, 128, "Type /signcheck %d to receive your paycheck.", CheckNumber[i]);
            SendClientMessage(i, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
            GameTextForPlayer(i, string, 5000, 1);
        }
    }
    return 1;
}
Reply
#5

You should be using "foreach", by "******"...

pawn Код:
public PayDay()
{
    new string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            Points[i][Announced] = 0;
            if (Points[i][Vulnerable] > 0)
            {
                Points[i][Vulnerable]--;
                UpdatePoints();
            }
        }
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayerInfo[i][pCheck] = 1;
            CheckNumber[i] = 1000+random(8999);
            format(string, 128, "Type /signcheck %d to receive your paycheck.", CheckNumber[i]);
            SendClientMessage(i, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
            GameTextForPlayer(i, string, 5000, 1);
        }
    }
    return 1;
}
Give that a shot.
Reply
#6

Alright cool. I'll test it out.
Reply
#7

Okay I found the "filterscript" What am I suppose to do with that? Can you link me to the page where I can get the "foreach" include?
Reply
#8

Sure, here you go...

It looks confusing, but instead of doing;

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
     {
You can just do;

pawn Код:
foreach(Player, i)
{
It's faster, more efficient and looks a lot better. Just include it and you will be able to use it.
Reply
#9

Okay I got the "foreach.inc" and replaced the

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
     {
with

pawn Код:
foreach(Player, i)
{
It seems as if it works now, I'm gonna wait till we have more then 10 people on so we can see if their gonna get Payday
Reply
#10

Quote:
Originally Posted by Lars_Frederiksen
Посмотреть сообщение
Okay I got the "foreach.inc" and replaced the

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
     {
with

pawn Код:
foreach(Player, i)
{
It seems as if it works now, I'm gonna wait till we have more then 10 people on so we can see if their gonna get Payday
I don't know if foreach will fix it, but it could... I know the code I gave you above had a change in one of the loops, but other then that, I didn't see anything wrong. You should use foreach all over though, it's better!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)