AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] NAME OF THE DAY!!!! (https://forums.alliedmods.net/showthread.php?t=170930)

Anonyme 10-30-2011 13:02

[HELP] NAME OF THE DAY!!!!
 
Hello Ams !

I'm using a FFA Plugin
And i want have the Name of the day

It's working perfectly,
But after the Day Sunday finish, i don't have the day Monday again.


I use this:

Quote:

player_hudmessage(0, 5, HUD_DELAY + 1.0, {0, 0, 255}, "%L", LANG_SERVER, "FFA_STATUS_DAY", g_Days [g_FFADay])


new const g_Days[][] =

{
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"

}

public round_first()
{
g_FFADay = 0

}
I think i have to add a commande like this:

Quote:

If(g_FFADay = 7)
{
g_FFADAY = 0
}
But i don't know who i have to add this commande...

KillLikoe 10-31-2011 08:26

Re: [HELP] NAME OF THE DAY!!!!
 
the week starts with sunday, you didnīt know?

eskemo 10-31-2011 09:03

Re: [HELP] NAME OF THE DAY!!!!
 
Quote:

Originally Posted by KillLikoe (Post 1587098)
the week starts with sunday, you didnīt know?

Why troll a guy who need's help with his scripting. His asking a question and expecting a awnser. Being a smart ass about it is stupid. He most likely know's more about scripting then you so why are you in "Scripting Help" trying to troll people. Go troll people on a social networking website.

Also for your plugin, not sure and not very good at scripting but couldnt it be.

Code:

player_hudmessage(0, 5, HUD_DELAY + 1.0, {0, 0, 255}, "%L", LANG_SERVER, "FFA_STATUS_DAY", g_Days [g_FFADay])


new const g_Days[][] = 

{
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
    "Sunday",
"test"

}

if ( g_Days == 8)
{
        g_Days = 0
}


KillLikoe 10-31-2011 10:05

Re: [HELP] NAME OF THE DAY!!!!
 
ok, sorry

Anonyme 10-31-2011 14:48

Re: [HELP] NAME OF THE DAY!!!!
 
@eskemo

It's doesn't works
take this is the full code:
http://pastebin.com/raw.php?i=M8ck3LYH

enjoi. 10-31-2011 14:57

Re: [HELP] NAME OF THE DAY!!!!
 
hes probably spanish and it starts on monday


and

http://forums.alliedmods.net/showthread.php?t=170929

Blue Snake. 10-31-2011 16:07

Re: [HELP] NAME OF THE DAY!!!!
 
eskemo, you can't check g_Days == 8, it's an array.

You need to add g_FFADays++ after that...or you should add here

PHP Code:

player_hudmessage(05HUD_DELAY 1.0, {00255}, "%L"LANG_SERVER"FFA_STATUS_DAY"g_Days [g_FFADay++]) 

Also, this is wrong. If you want to compare 2 integers, you use ==, not =
PHP Code:

If(g_FFADay 7

So your code should be
PHP Code:

If(g_FFADay == 7


Emp` 10-31-2011 16:38

Re: [HELP] NAME OF THE DAY!!!!
 
When you increment g_FFADay, if it is larger than the size you should reset it.
Code:

g_FFADay++
if ( g_FFADay >= sizeof g_Days )
    g_FFADay = 0;

Note this can also be done easily with the modulus operator:
Code:

g_FFADay = ( g_FFADay + 1 ) % sizeof g_Days;

Anonyme 10-31-2011 16:54

Re: [HELP] NAME OF THE DAY!!!!
 
[quote=Emp`;1587395]
Code:

g_FFADay++
if ( g_FFADay >= sizeof g_Days )
    g_FFADay = 0;

You are my hero!

It's works 100%!

Please, can you help here now: https://forums.alliedmods.net/showthread.php?t=171028


All times are GMT -4. The time now is 14:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.