SA-MP Forums Archive
Incomplete string? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Incomplete string? (/showthread.php?tid=585057)



Incomplete string? - Metharon - 10.08.2015

http://i.imgur.com/MR43DgK.png

new index = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{

if(PlayerInfo[i][pAdmin] == 0) continue;
index ++;
if(index == 1) { SendClientMessage(playerid, COLOR_GRAD2, "[ADMINS ONLINE]"); }
format(string, 456, "%s (%d)", index, GetName(i),PlayerInfo[i][pAdmin]);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
if(index == 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " Nu este nici un administrator online acum.");
}

Why the fuck is only [4] ?


Re: Incomplete string? - MarvinPWN - 10.08.2015

PHP код:
new index;
for(new 
i;i<MAX_PLAYERS;i++)
{
    if(
PlayerInfo[i][pAdmin] == 0)continue;
    
index ++;
    if(
index == 1)SendClientMessage(playerid,COLOR_GRAD2,"[ADMINS ONLINE]");
    
format(string,sizeof string,"%s%i. %s (%d)\n",string,index,GetName(i),PlayerInfo[i][pAdmin]);
    
SendClientMessage(playerid,COLOR_GRAD2,string);
}
if(!
index)SendClientMessage(playerid,COLOR_LIGHTRED,"Nu este nici un administrator online acum.");