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(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()
}
}
- 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)))