Can someone explain what this means?
#1

Hello. My friend gave me his script to work on since he retired. The payday system is bugged and I don't know why. Can someone explain to me what this line means, piece by piece please?

pawn Код:
new currentHour = GetCurrentHour(), string[128];
if(currentHour == (TMPHour[0] + 1) || (TMPHour[0] == 23 && currentHour == 0))
{
This is the GetCurrentHour function:

pawn Код:
stock GetCurrentHour()
{
    new currentHour[3];
    gettime(currentHour[0], currentHour[1], currentHour[2]);
    return currentHour[0];
}
And under a loop that executes every 30 seconds:

pawn Код:
gettime(TMPHour[0], TMPHour[1], TMPHour[2]);
Reply
#2

Were there any compile errors there?
Reply
#3

Код:
new currentHour = GetCurrentHour()
This is him getting the number of the hour (so if it's 2:00AM it returns 2, if it's 11:33AM it returns 11)

Код:
stock GetCurrentHour()
{
    new currentHour[3];
    gettime(currentHour[0], currentHour[1], currentHour[2]);
    return currentHour[0];
}
This should be pretty easy, if you're familiar with PAWN at all, or any programming.. He's defining a new array (new currentHour[3]) with 3 slots.. (0, 1, 2).

He's then getting the hour, minute, and second with gettime and assigning them to slots in the array he just created.

Then he's returning the HOUR (for the thing we discussed above "currentHour").

Please post the entire script and explain what you mean by "bugged" and I'll try to help figure it out. For now I see nothing that's wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)