Raised This Month: $51 Target: $400
 12% 

#Game_Commencing help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tristanoff
Junior Member
Join Date: Oct 2011
Old 03-31-2014 , 12:38   #Game_Commencing help
Reply With Quote #1

Hi, im triying to force/execute Game commencing ( its when there is just 1 player in a team and another one (2) connects and join enemy team. A message (center) "Game commencing" its shown and the server restart the round)...

Func that doesn't work:
PHP Code:
public GameComencing()
{
    
message_begin(MSG_ALLget_user_msgid("TextMsg"), {0,0,0}, 0);
    
write_byte(print_center);
    
write_string("#Game_Commencing");
    
message_end();

Some func to see the message ( never happens) :
PHP Code:
public plugin_init()
{
   
register_message(get_user_msgid("TextMsg"), "onTextMsg");
}

public 
onTextMsg(msgIdmsgDestmsgEnt)
{
    static 
buffer[32];
    
get_msg_arg_string(2buffer31);

    if(
equal(buffer"#Game_Commencing"))
    {
       
server_print("Message: %d - %s - %d - %d"msgIdbuffermsgDestmsgEnt);
    }

    return 
PLUGIN_CONTINUE;

tristanoff is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-31-2014 , 21:44   Re: #Game_Commencing help
Reply With Quote #2

Why do you need such plugin/code when Counter-Strike 1.6 is made that way?


Code:
server_print("Message: %d - %s - %d - %d", msgId, buffer, msgDest, msgEnt);



Code:
client_print( 0, print_center, "Message: %d - %s - %d - %d", msgId, buffer, msgDest, msgEnt );

The message will be at the center of everyone screen.
__________________
Like my clean plugins and work?

Last edited by Baws; 03-31-2014 at 21:47.
Baws is offline
extream87
Senior Member
Join Date: Aug 2011
Old 04-01-2014 , 07:10   Re: #Game_Commencing help
Reply With Quote #3

You need to check team players.
Example:
if ct player = 1
code

if t player = 1
code

Code:
    new iTEcount, iCTcount, players[32];     get_players(players, iTEcount, "e", "TERRORIST");     get_players(players, iCTcount, "e", "CT");           if ( iTEcount == 1 )     {         //Your message     }         else if ( iCTcount == 1 )     {         //Your message     }

Last edited by extream87; 04-01-2014 at 07:17.
extream87 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 04:31.


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