Client set ping

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
Freezo
Naujokas apylinkėse
Posts: 1
Joined: 2015 Jan 10 21:35

Client set ping

Post by Freezo »

Hello ( Sorry i speak only english and frensh and its really bad x) ) ,

i've this script

[php] #include <amxmodx> #include <fakemeta>  public plugin_init() {     register_forward(FM_UpdateClientData, "fw_updateClientData") }  public fw_updateClientData(id) {     if ( ! ( pev(id, pev_button) & IN_SCORE ) )          return;          new ping = 10     new ping1     new offset1          for(new player = 1; player < get_maxplayers(); player++)     {         if(!is_user_connected(id))             continue;                  for(new offset1 = 0; offset1 < 4; offset1++)         {             if ((ping - offset1) % 4 == 0)             {                 ping1 = (ping - offset1) / 4                 break;             }         }         message_begin(MSG_ONE_UNRELIABLE, SVC_PINGS, _, id)         write_byte((offset1 * 64) + (1 + 2 * (player - 1)))         write_short(ping1)         write_byte(0)         message_end()     } }   [/php]

i need you to explain to me

this :
for(new offset1 = 0; offset1 < 4; offset1++)
{
if ((ping - offset1) % 4 == 0)
{
ping1 = (ping - offset1) / 4
break;
}
}

and this :

write_byte((offset1 * 64) + (1 + 2 * (player - 1)))

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests