#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dini>
new admin[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Adminscript\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
new fname[64],n[24]; GetPlayerName(playerid,n,24);
format(fname,64,\"Players/%s.conf\",n);
dini_Create(fname); //a dini.inc-ben már benne van az ha már megvan a fájl akkor nem csinál újat
admin[playerid] = dini_Int(fname,\"Admin\");
if(admin[playerid] > 0) {
SendClientMessage(playerid,-1,\"Üdv a szerveren, Admin!\");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new fname[64],n[24]; GetPlayerName(playerid,n,24);
format(fname,64,\"Players/%s.conf\",n);
dini_IntSet(fname,\"Admin\",admin[playerid]);
return 1;
}
CMD:adminad(playerid,params[])
{
new toplayer,adminlvl;
if(sscanf(params,\"ud\",toplayer,adminlvl)) return SendClientMessage(playerid,-1,\"/adminad [player] [0-5]\");
if(adminlvl > 5 || adminlvl < 0) return SendClientMessage(playerid,-1,\"0-5\");
admin[toplayer] = adminlvl;
return 1;
}