How I can get server's IP
#10

Quote:
Originally Posted by SmileyForCheat
Посмотреть сообщение
pawn Код:
new mess[256],IP[256];
    GetPlayerIp(playerid,IP,sizeof(IP));

format(mess,sizeof(mess),"IP: %s",IP);
SendClientMessageToAll(COLOR_LIGHTBLUE,mess);
Here, you are using 2KB of memory...

IP has 16 cells, not 256, "mess" has 21, in total that is 340 bytes if I calculated correctly.
So, here you are wasting 1708 (2048 - 340) extra bytes of memory in that code... This code needs 340 bytes, yours is 2048 bytes.
The calculation might not be correct, but you are wasting hell lot of memory! I suggest you to read this.
Reply


Messages In This Thread
How I can get server's IP - by IstuntmanI - 06.07.2011, 10:25
Re: How I can get server's IP - by SmileyForCheat - 06.07.2011, 10:28
Re: How I can get server's IP - by IstuntmanI - 06.07.2011, 10:29
Re: How I can get server's IP - by SmileyForCheat - 06.07.2011, 10:33
Re: How I can get server's IP - by cessil - 06.07.2011, 10:33
Re: How I can get server's IP - by IstuntmanI - 06.07.2011, 10:39
Re: How I can get server's IP - by Jochemd - 06.07.2011, 10:46
Re: How I can get server's IP - by IstuntmanI - 06.07.2011, 11:11
Re: How I can get server's IP - by PrawkC - 06.07.2011, 11:38
Re: How I can get server's IP - by Mean - 06.07.2011, 11:41

Forum Jump:


Users browsing this thread: 3 Guest(s)