Help in this command. - 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: Help in this command. (
/showthread.php?tid=536130)
Help in this command. -
krytans - 07.09.2014
pawn Код:
CMD:oadmin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 100001) return SendClientMessage(playerid, COLOR_GRAD, "You are not authorized to use this command!");
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
format(string, sizeof(string), "users/%s.ini", i);
new alevel = dini_Get(string, "AdminLvl")
if(alevel > 0)
{
format(string, sizeof(string), "%s -level %s lastlogin [%s]",i, alevel, dini_Get(string, "LastLogin"));
SendClientMessage(playerid, COLOR_WHITE, string);
break;
}
}
}
I made a command to list all offline admin. Is this correct?
Re: Help in this command. -
Stinged - 07.09.2014
Quote:
Originally Posted by krytans
pawn Код:
for(new i = 0; i < MAX_PLAYER_NAME; i++)
|
This will add 1 to i every time it's not equal to 24.
So you're just opening a file called 0, 1, 2, 3, 4, 5 etc...
Re: Help in this command. -
krytans - 07.09.2014
Is there anyway to make command?
Re: Help in this command. -
AroseKhanNiazi - 07.09.2014
yes there is but i also don't know how to do it i have the idea but its difficult you need to run an loop from all the players stored and then find the value that you want or easier way is if you know the name just load that file using params for this will be good
Re: Help in this command. -
krytans - 07.09.2014
Then how to record who are all admins in separate place?
Re: Help in this command. -
Stinged - 07.09.2014
There are 2 ways:
1) You add them in pawn
2) You add something using file functions in your set admin command that gets the player's name and stores it into 'admins file'.
Re: Help in this command. -
krytans - 07.09.2014
What do i add in pawn?
Re: Help in this command. -
Stinged - 07.09.2014
The admin names.
For example "users/Myadmin1.ini" "users/Myadmin2.ini"
Re: Help in this command. -
krytans - 07.09.2014
Alright, Thanks.