AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   #Game_Commencing help (https://forums.alliedmods.net/showthread.php?t=237901)

tristanoff 03-31-2014 12:38

#Game_Commencing help
 
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;



Baws 03-31-2014 21:44

Re: #Game_Commencing help
 
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);

:arrow:

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.

extream87 04-01-2014 07:10

Re: #Game_Commencing help
 
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     }


All times are GMT -4. The time now is 06:03.

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