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

Client set ping


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-10-2015 , 14:12   Client set ping
Reply With Quote #1

Hey , Again so i need someone to explain to me some functions in this script :

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_forward(FM_UpdateClientData"fw_updateClientData")
}

public 
fw_updateClientData(id)
{
    if ( ! ( 
pev(idpev_button) & IN_SCORE ) ) 
        return;
    
    new 
ping 10
    
new ping1
    
new offset1
    
    
for(new player 1player get_maxplayers(); player++)
    {
        if(!
is_user_connected(id))
            continue;
        
        for(new 
offset1 0offset1 4offset1++)
        {
            if ((
ping offset1) % == 0)
            {
                
ping1 = (ping offset1) / 4
                
break;
            }
        }
        
message_begin(MSG_ONE_UNRELIABLESVC_PINGS_id)
        
write_byte((offset1 64) + (* (player 1)))
        
write_short(ping1)
        
write_byte(0)
        
message_end()
    }

  • First why doing a loop to check if a (ping - 1 or 2 or 3 or 4 ) / 4 equal to 0
  • Why set it like this ping1 = (ping - offset1) / 4
  • i don't get this at all write_byte((offset1 * 64) + (1 + 2 * (player - 1)))
Freezo Begin 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 21:37.


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