10.07.2018, 16:59
Today I learnt how I can cut the second for loop and strcmp in this code:
Think if you can work around and cut the 2nd 'for' loop and strcmp. note: checking IPs at OnPlayerConnect is not the solution...
PHP код:
CMD:checkips(playerid, params[])
{
for(new i; i < MAX_PLAYERS; i++)
{
new pIP[16];
GetPlayerIP(i, pIP, sizeof(pIP));
for(new k; k < MAX_PLAYERS; k++)
{
new pIP2[16];
GetPlayerIP(k, pIP2, sizeof(pIP2));
if(!strcmp(pIP, pIP2))
//IPs matched inform them
}
}
return 1;
}