Need some help with dini!
#1

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.
Reply
#2

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.
Reply
#3

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)