AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change teams score (https://forums.alliedmods.net/showthread.php?t=194392)

Explain 08-27-2012 21:35

Change teams score
 
Hello, how I can change teams score in scoreboard? Or block adding when hostages not rescued.

jimaway 08-28-2012 06:06

Re: Change teams score
 
teamscore event

hook the event to block adding, send the messge to change

Explain 08-28-2012 12:57

Re: Change teams score
 
For test I written it:
PHP Code:

    register_event("TeamScore""block_scoreborad_add""a")

public 
block_scoreboard_add()
{
    new 
team_name_to_block read_data(1)
    if(
team_name_to_block == "TERRORIST")
    {
        
client_print(0print_center"Round draw!")
    }


But:
Quote:

error 033: array must be indexed (variable "-unknown-")
Help.

jimaway 08-28-2012 13:45

Re: Change teams score
 
new team_name_to_block[10] = read_data(1)
if(equal(team_name_to_block,"TERRORIST"))

Explain 08-28-2012 22:02

Re: Change teams score
 
Exactly, always forget that should use equal, thanks. And array.

Quote:

error 008: must be a constant expression; assumed zero

jimaway 08-29-2012 05:35

Re: Change teams score
 
new team_name_to_block[10]
read_data(1, team_name_to_block, charsmax(team_name_to_block))

Explain 08-29-2012 10:08

Re: Change teams score
 
You mean charsmax in code.

jimaway 08-29-2012 11:59

Re: Change teams score
 
my bad, fixed

Explain 08-29-2012 22:55

Re: Change teams score
 
PHP Code:

public block_scoreboard_add()
{
    new 
team_name_to_block[10]
    
read_data(1team_name_to_blockcharsmax(team_name_to_block))
    if(
equal(team_name_to_block"TERRORIST"))
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE


Doesn't work.

jimaway 08-30-2012 05:21

Re: Change teams score
 
register_event("TeamScore", "block_scoreborad_add", "a")

public block_scoreboard_add()


http://i0.kym-cdn.com/entries/icons/...4/facepalm.jpg


All times are GMT -4. The time now is 05:51.

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