Checking all offline accounts for admin status.
#1

I am trying to create a command: /oadmins and it shows all Offline admins but i don't want to create any extra Scriptfiles.. is their anyway that i can do this? I am using dudb.sav.

I try'd this but obviously to experianced scripters it dosent work..
Код:
COMMAND:oadmins(playerid, params[])
{
    new stringa[MAX_STRING];
	PlayerLoop(i)
	{
		if(PlayerInfo[playerid][power]) return SendClientError(playerid, CANT_USE_CMD);
		new iFile[MAX_PLAYER_NAME+10];
		format(iFile,sizeof(iFile),"%s.dudb.sav",iFile);
		SendClientMessage(playerid, COLOR_BLUE, "Admins Offline:");
		format(stringa,sizeof(stringa),"%s - Level: %d - Laston: %d",iFile,dini_Int(iFile,"power"),dini_Int(iFile,"lastonline"));
		SendClientMessage(playerid,COLOR_GREY,stringa);
		return 1;
	}
}
please dont comment if you dont have anything positive to say e.g. Noob, you sux.. or OMG not even close.. I come here to get support.. and any given is 100% appreciated.

FYI: I am new to scripting.
Reply
#2

If you don't want to add anything extra in scriptfiles, then you're going to have a bad time. There is a plugin where you can loop through all files in a folder (forgot the name of it) but it's really not efficient. Change to something like SQLite and this would be a breeze.
Reply
#3

The best way to do it with files is to actually create a file with all admin's and read from it...that is a best way i can suggest you with files, or like TheKiller told you, move to SQL (MySql or SqlLite) and its gonna be piece of cake to make (not to mention all other possibilities)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)