AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New Round? (https://forums.alliedmods.net/showthread.php?t=171515)

MiloSx7 11-07-2011 02:56

New Round?
 
I have a bool

new bool:boughtitem[33] = false

And whenever a player buys in my menu, bool became true, and then untill New Round bool remains true...
When the new round begin, bool is false, again...

How to detect new round?
Without using HLTV, cause i need the (index) in front of the public HLTV(id)

fysiks 11-07-2011 03:14

Re: New Round?
 
http://forums.alliedmods.net/showthread.php?t=42159

If you really want new round you use the hltv method and loop through players to to reset the bool.

If you would rather say "once per life" then you would use Ham_Spawn.

However, if you don't modify the original spawning then both methods are essentially the same.

ConnorMcLeod 11-07-2011 04:29

Re: New Round?
 
PHP Code:

#include <amxmodx>

new bool:boughtitem[33]

public 
plugin_init()
{
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
}

public 
Event_HLTV_New_Round()
{
    
arrayset(boughtitemfalsesizeof(boughtitem))


or theorically better :

PHP Code:

#include <amxmodx>

new bool:boughtitem[33]

new 
g_iMaxPlayers

public plugin_init()
{
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
g_iMaxPlayers get_maxplayers()
}

public 
Event_HLTV_New_Round()
{
    
arrayset(boughtitemfalseg_iMaxPlayers+1)




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

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