AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   wOw Change Team Score (???) (https://forums.alliedmods.net/showthread.php?t=196332)

^SmileY 09-18-2012 20:42

wOw Change Team Score (???)
 
Hello, i found a method to change the team score value:

>> http://forums.alliedmods.net/showthr...set_team_score


But, in the topic the stock is:

PHP Code:

stock cs_set_team_scoreCsTeams:cstTeam iScore )
{     
    if ( !( 
CS_TEAM_T <= cstTeam <= CS_TEAM_CT ) )
        return 
0;

    
message_beginMSG_ALL get_user_msgid("TeamScore") , {0,0,0} );
    
write_stringcstTeam == CS_TEAM_T "TERRORIST" "CT" );
    
write_byteiScore );
    
message_end();
    
    return 
1;


I have decided to test, but this function set team score to -1 ..
I have to search a HL1 Game events and discovered its function its wrong:

http://wiki.amxmodx.org/Half-Life_1_...ents#TeamScore

in wiki a correct way its:

PHP Code:

stock cs_set_team_score(CsTeams:iTeam,iScore)
{     
    if(!(
CS_TEAM_T <= iTeam <= CS_TEAM_CT)) return PLUGIN_CONTINUE;

    
message_begin(MSG_ALL,get_user_msgid("TeamScore"),{0,0,0});
    
write_string(iTeam == CS_TEAM_T "TERRORIST" "CT");
    
write_short(iScore);
    
message_end();

    return 
PLUGIN_HANDLED;


PHP Code:

write_byte(iScore);

to

write_short
(iScore); 

Its safe to use this method?


Thanks.

Bugsy 09-18-2012 22:25

Re: wOw Change Team Score (???)
 
Have you tested? Does it work?

^SmileY 09-19-2012 18:33

Re: wOw Change Team Score (???)
 
yes, but the scores are back to original in round end.
The question is: it the original scores change or only the scoreboard?

Bugsy 09-19-2012 21:37

Re: wOw Change Team Score (???)
 
That is only for updating scoreboard.

^SmileY 09-22-2012 14:02

Re: wOw Change Team Score (???)
 
OK, i will test using orpheu later :)


All times are GMT -4. The time now is 08:10.

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