SA-MP Forums Archive
Saving Admin Level.. - 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: Saving Admin Level.. (/showthread.php?tid=315039)



Saving Admin Level.. - vassilis - 01.02.2012

Tittle says it all...well i have make an /setadmin command
here is the enumeration i use

pawn Code:
enum iDetails {
    Pass,
    Cash,
    Score,
    Banned,
    AdminLVL
};
now its ok when i use setadmin command it will put this admin level normally.I have made and the database normally but how i can make it so it will automatically put the admin level i had set when player connects?


Re: Saving Admin Level.. - Konstantinos - 01.02.2012

It's Enumeration, not enumation and delete the last "," on the AdminLVL.
Just load the User Data and your variable will wear it on it.
For example, PlayerInfo[ playerid ][ AdminLVL ] will wear the level


Re: Saving Admin Level.. - vassilis - 02.02.2012

pawn Code:
public UserDataLoad_data(playerid,name[],value[]) {
    INI_Int("Pass",pInfo[playerid][Pass]);
    INI_String("IP",pIP[playerid],16);
    INI_Int("Admin",pInfo[playerid][AdminLVL]);
    INI_Int("Cash",pInfo[playerid][Cash]);
    INI_Int("Score",pInfo[playerid][Score]);
    INI_Int("Banned",pInfo[playerid][Banned]);
    return 1;
}
this is what i have


Re: Saving Admin Level.. - Konstantinos - 02.02.2012

Correct and after login parseFile the data to the user, unless he type wrong password.
Then the data will be ok. By the way, is the password numeric, because if it's not then use INI_String, not INI_Int.