Raised This Month: $ Target: $400
 0% 

wOw Change Team Score (???)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 09-18-2012 , 20:42   wOw Change Team Score (???)
Reply With Quote #1

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.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 08:10.


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