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

MSG_ONE to MSG_BROADCAST


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JusTGo
Veteran Member
Join Date: Mar 2013
Old 04-04-2016 , 17:12   MSG_ONE to MSG_BROADCAST
Reply With Quote #1

PHP Code:
public ham_Killed_PostidAttackershouldgib )
{
    new 
Float:flLocation];
    
pevidpev_originflLocation );
    
    new 
players32 ], numplayer;
    
get_playersplayersnum );
    for( new 
num ++ )
    {
        
player players];
        if( 
get_user_teamplayer ) != get_user_teamid ) || !is_user_aliveplayer ) )
        continue;
            
        
message_beginMSG_ONE_UNRELIABLEg_msgHostageAdd, { 00}, player );
        
write_byteplayer );
        
write_byteid )    ;    
        
engfuncEngFunc_WriteCoordflLocation] );
        
engfuncEngFunc_WriteCoordflLocation] );
        
engfuncEngFunc_WriteCoordflLocation] );
        
message_end();
                
        
message_beginMSG_ONE_UNRELIABLEg_msgHostageDel, { 00}, player );
        
write_byteid );
        
message_end();
    }

is it possible for this message to be sent to all players with MSG_BROADCAST ?
__________________
JusTGo is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-04-2016 , 19:23   Re: MSG_ONE to MSG_BROADCAST
Reply With Quote #2

PHP Code:
    for( new num ++ ) 
    { 
        
player players]; 
        if( 
get_user_teamplayer ) != get_user_teamid ) || !is_user_aliveplayer ) ) 
        continue; 
             
        
message_beginMSG_BROADCASTg_msgHostageAdd); 
        
write_byteplayer ); 
        
write_byteid )    ;     
        
engfuncEngFunc_WriteCoordflLocation] ); 
        
engfuncEngFunc_WriteCoordflLocation] ); 
        
engfuncEngFunc_WriteCoordflLocation] ); 
        
message_end(); 
                 
        
message_beginMSG_ONE_UNRELIABLEg_msgHostageDel, { 00}, player ); 
        
write_byteid ); 
        
message_end(); 
    } 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-04-2016 at 19:25.
EFFx is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-05-2016 , 11:59   Re: MSG_ONE to MSG_BROADCAST
Reply With Quote #3

just a correction on get user team:
it is more efficient to do
new tmp_team = get_user_team(id) //write this above the loop

then change to this in loop:

if( get_user_team( player ) != tmp_team)


because you are calling get user team for same player multiple times which makes no sense

Last edited by siriusmd99; 04-05-2016 at 12:00.
siriusmd99 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 06:47.


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