Help me fix this please. -
Lars_Frederiksen - 29.11.2010
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.
Re: Help me fix this please. -
Scenario - 30.11.2010
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!
Re: Help me fix this please. -
Steven82 - 30.11.2010
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)
Re: Help me fix this please. -
Lars_Frederiksen - 30.11.2010
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;
}
Re: Help me fix this please. -
Scenario - 30.11.2010
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.
Re: Help me fix this please. -
Lars_Frederiksen - 30.11.2010
Alright cool. I'll test it out.
Re: Help me fix this please. -
Lars_Frederiksen - 30.11.2010
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?
Re: Help me fix this please. -
Scenario - 30.11.2010
Sure,
here you go...
It looks confusing, but instead of doing;
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
You can just do;
It's faster, more efficient and looks a lot better. Just include it and you will be able to use it.
Re: Help me fix this please. -
Lars_Frederiksen - 30.11.2010
Okay I got the "foreach.inc" and replaced the
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
with
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
Re: Help me fix this please. -
Scenario - 30.11.2010
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
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!