Raised This Month: $ Target: $400
 0% 

Change teams score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Explain
Junior Member
Join Date: Aug 2012
Old 08-27-2012 , 21:35   Change teams score
Reply With Quote #1

Hello, how I can change teams score in scoreboard? Or block adding when hostages not rescued.
Explain is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-28-2012 , 06:06   Re: Change teams score
Reply With Quote #2

teamscore event

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

Last edited by jimaway; 08-28-2012 at 06:11.
jimaway is offline
Explain
Junior Member
Join Date: Aug 2012
Old 08-28-2012 , 12:57   Re: Change teams score
Reply With Quote #3

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.
Explain is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-28-2012 , 13:45   Re: Change teams score
Reply With Quote #4

new team_name_to_block[10] = read_data(1)
if(equal(team_name_to_block,"TERRORIST"))
jimaway is offline
Explain
Junior Member
Join Date: Aug 2012
Old 08-28-2012 , 22:02   Re: Change teams score
Reply With Quote #5

Exactly, always forget that should use equal, thanks. And array.

Quote:
error 008: must be a constant expression; assumed zero

Last edited by Explain; 08-29-2012 at 05:25.
Explain is offline
Old 08-29-2012, 00:58
Explain
This message has been deleted by ConnorMcLeod. Reason: use edit button
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-29-2012 , 05:35   Re: Change teams score
Reply With Quote #6

new team_name_to_block[10]
read_data(1, team_name_to_block, charsmax(team_name_to_block))

Last edited by jimaway; 08-29-2012 at 11:59.
jimaway is offline
Explain
Junior Member
Join Date: Aug 2012
Old 08-29-2012 , 10:08   Re: Change teams score
Reply With Quote #7

You mean charsmax in code.
Explain is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-29-2012 , 11:59   Re: Change teams score
Reply With Quote #8

my bad, fixed
jimaway is offline
Explain
Junior Member
Join Date: Aug 2012
Old 08-29-2012 , 22:55   Re: Change teams score
Reply With Quote #9

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.
Explain is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-30-2012 , 05:21   Re: Change teams score
Reply With Quote #10

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

public block_scoreboard_add()


jimaway is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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