Hi leute, ich hab mir mal n adminsystem gemacht, aber admin speichert nicht -.-
enum blalbla
admin,
dcmd_makeadmin(playerid,params[]) {
if(SpielerS[playerid][admin]>=5 || IsPlayerAdmin(playerid)) {
if(!strlen(params)) return SendClientMessage(playerid,COLOR_RED,"/Makeadmin [ID] [LEVEL]");
new typ = strval(strget(params,0));
if(IsPlayerConnected(typ)) {
if(!strlen(strget(params,1))) return SendClientMessage(playerid,COLOR_RED,"/Makeadmin [ID] [LEVEL]");
new adminlvl = strval(strget(params,1));
if(adminlvl>=0 && adminlvl<=5) {
new s[100], name[16];
GetPlayerName(typ,name,sizeof(name));
format(s,sizeof(s),"Du hast %s zum Admin Level %d gemacht",name,adminlvl);
SendClientMessage(playerid,COLOR_RED,s);
GetPlayerName(playerid,name,sizeof(name));
format(s,sizeof(s),"%s hat dich zum Admin Level %d gemacht",name,adminlvl);
SendClientMessage(typ,COLOR_RED,s); SpielerS[typ][admin] = adminlvl; }
else { SendClientMessage(playerid,COLOR_RED,"Inkorrektes Level"); }}
else { SendClientMessage(playerid,COLOR_RED,"ID nicht vergeben"); }}
else { SendClientMessage(playerid,COLOR_RED,"Dein Admin Level ist nich hoch genung"); }
return 1;
}
dcmd_register(playerid,params[]) {
if(!strlen(params)) return SendClientMessage(playerid,COLOR_SYSTEM,"/register Passwort");
new name[MAX_PLAYER_NAME], s[256];
GetPlayerName(playerid,name,sizeof(name));
format(s,sizeof(s),"%s.ini",name);
if(!dini_Exists(s)) {
dini_Create(s);
new ip[15];
GetPlayerIp(playerid,ip,sizeof(ip));
dini_Set(s,"ip",ip);
dini_IntSet(s,"passwort",udb_hash(params));
dini_IntSet(s,"kills",0);
dini_IntSet(s,"admin",0);
dini_IntSet(s,"geld",GetPlayerMoney(playerid));
dini_IntSet(s,"skin",GetPlayerSkin(playerid));
SendClientMessage(playerid,COLOR_RED," Herzlichen Glückwunsch, Du hast dich Erfolgreich Registriert.");
SendClientMessage(playerid,COLOR_RED," Bitte logge dich jetzt mit '/login [Passwort] ein.");
} else {
SendClientMessage(playerid,COLOR_RED," Du bist schon Registriert.");
}
return 1;
}
dcmd_login(playerid,params[]) {
if(!strlen(params)) return SendClientMessage(playerid,COLOR_SYSTEM,"/login Passwort");
new name[MAX_PLAYER_NAME], s[20], s2[256];
GetPlayerName(playerid,name,sizeof(name));
format(s,sizeof(s),"%s.ini",name);
if(dini_Exists(s)) {
s2=dini_Get(s,"passwort");
if(strval(s2)==udb_hash(params)) {
SendClientMessage(playerid,COLOR_RED," Erfolgreich Eingeloggt.");
SpielerS[playerid][kills]=dini_Int(s,"kills");
GivePlayerMoney(playerid,SpielerS[playerid][geld]);
SetPlayerSkin(playerid,SpielerS[playerid][skin]);
SpielerS[playerid][admin]=dini_Int(s,"admin");
}
}
return 1;
}
Weiß jemand Warum?