SA-MP Forums Archive
Need some help with dini! - 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: Need some help with dini! (/showthread.php?tid=299328)



Need some help with dini! - LiamM - 25.11.2011

Hey guys well I need some assistance, I know how to loop through on players... but how do I loop through offline players? Reason why is for example if I wanted to set a leader of an org but there was already someone leading it... it would make 2 leaders for the 1 org which isn't what I want... so how would I loop through ALL players including the ones offline and check there files to see if anyone leads it? Would this work??

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
new CheckforLeader[128];
format(CheckforLeader, sizeof(CheckforLeader), "DirectoryPath/Directory/%i.ini", i);
if(PlayerInfo[i][Leader] == 1)
{
SendClientMessage(playerid, COLOR, "There is already a leader for this organization");
return 1;
}
}
Or something like that, thanks so much in advanced.


Re: Need some help with dini! - Calgon - 25.11.2011

You'll need a plugin similar to y_files, it provides an integer (number) you can use to index in a loop through all players.

pawn Код:
native ffind(const pattern[], filename[], len, &idx);
The 'idx' parameter is the number you can use, if I remember correctly.


Re: Need some help with dini! - LiamM - 25.11.2011

Quote:
Originally Posted by Calgon
Посмотреть сообщение
You'll need a plugin similar to y_files, it provides an integer (number) you can use to index in a loop through all players.

pawn Код:
native ffind(const pattern[], filename[], len, &idx);
The 'idx' parameter is the number you can use, if I remember correctly.
Well the dini files are saved by the Players name.. not an integer. Would this still work? If so how would I use this?