|POMOC| U vezi admin koda.

Započeo #Dowla, Mart 05, 2013, 13:09:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Dowlin - Maximum Gaming
Detaljan opis problema: Ne radi admin kod, tj bilo sta da odkucam cu da prodjem proveru. :/
Dio skripte: Postavicu, sta treba.
Kod: ...
Neke slike/video za lakse dobivanje pomoci(neobavezno):

Ne kapiras. :D Hocu da mi sacuva onaj "ADMIN KOD", sto dobijes kad dobijes admina. :D

if(dialogid == 3214)
{
if(!response) return Kick(playerid);
if(response)
{
if(strcmp(inputtext,PlayerInfo[playerid][pAsifra], true) == 0)
{
SendClientMessage(playerid, -1, "Prosli ste proveru.");
}
else { Kick(playerid); }
//
}
return 1;
}


Obljasni, al kolko sam te shvatio, msm da su brojevi. :D

Evo ti "/makeadmin"
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "MG-RP: /makeadmin [Korisnicki ID/Ime Korisnika] [level(1-7)] [Slot]");
return 1;
}
new para1;
new level;
new slot;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
tmp = strtok(cmdtext, idx);
slot = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 6)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
strreplace(giveplayer, '_', ' ');
GetPlayerName(playerid, sendername, sizeof(sendername));
strreplace(sendername, '_', ' ');
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pAdminSlot] = slot;
printf("AdmCmd: %s je promovisao %s za Admin level %d.", sendername, giveplayer, level);
format(string, sizeof(string), "{FF0080}MG-RP: Dobili ste admin level %d i postavljeni ste na slot %d od strane || %s", level,slot, sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), "{FF0080}MG-RP: Promovisali ste %s za level %d Admin-a na slot %d.", giveplayer,level,slot);
SendClientMessage(playerid, COLOR_WHITE, string);
    new name[MAX_PLAYER_NAME];
    SetPlayerSkin(playerid, 249);
    GetPlayerName(playerid, name, sizeof(name));
        new loginstring[512];
        new str[128];
//                      new loginstring1[512];
                        new loginsve[1024];
                        new year,month,day;
                        getdate(year,month, day);
                        new hour,minute;
                    gettime(hour, minute);
                    new sifra = random(2000) * 43;
format(string, sizeof(str), "Vasa admin sifra je %d, moracete je ukucati na svakom loginu radi provjere identiteta.", sifra);
SendClientMessage(para1, COLOR_WHITE, string);
PlayerInfo[playerid][pAsifra] = sifra;
                    format(loginstring,sizeof(loginstring),"Cestitamo vam, dobili ste admina na Maximum Gaming-u.\n\n \n VAS ADMIN KOD JE: %d \n Vase ime: %s\n Admin koji vam dao: %s\n Admin level: %d\n Admin slot: %d\n Datum: %d/%d/%d | Vreme: %d:%d",sifra,name,sendername,level,slot,month,day,year,hour,minute);
                    // format(loginstring1,sizeof(loginstring1),"  "); // AKO JE OVAJ MALI STRING ! :)
                    format(loginsve, 1024," %s%s%s",loginstring);
                    SPD(giveplayerid,8375,DIALOG_STYLE_MSGBOX,"{FF0080}Admin Obavestenje!",loginsve,"OK","");
if(level == 0 && PlayerInfo[para1][pDowla] > 0 && PlayerInfo[playerid][pDowla] < 1) return SCM(playerid, SIVA, "   Nisi valjda mislio da mozes Dowli da skines admina!? o.O :D");
if(slot == 0) { SetPlayerColor(para1, COLOR_BLACK); return 1; }
else if(slot == 1) { SetPlayerColor(para1, COLOR_BLACK);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/1.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 2) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/2.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 3) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/3.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 4) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/4.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 5) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/5.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 6) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/6.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 7) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/7.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 8) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/8.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 9) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/9.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 10) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/10.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 11) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/11.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 12) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/12.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 13) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/13.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 14) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/14.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 15) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/15.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 16) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/16.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 17) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/17.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 18) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/18.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 19) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/19.txt", io_write)
fwrite(log, text);
fclose(log); }
else if(slot == 20) { SetPlayerColor(para1, TEAM_VAGOS_COLOR);
new text[80];
format(text,64,"%s",GetName(para1));
new File:log;
log = fopen("Admini/20.txt", io_write)
fwrite(log, text);
fclose(log); }
SaveAccounts();
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni!");
}
}
return 1;
}
Poslednja Izmena: Mart 05, 2013, 15:41:59 POSLE PODNE od Falcon.

Gde da upisem? o.O :D
Edit: Nasao sam gde, al opet ne kapiram sta da upisem.
Poslednja Izmena: Mart 05, 2013, 16:03:18 POSLE PODNE od Falcon.

Stavio sam "pAsifra" Ali i dalje nece. :/

pa samo to imam pod enum pInfo: "pAsifra"


Omg, ovo imam "pAsifra" El zna mozda neko drugi ovo, u cemu je problem?

#define DIALOG_ADMINPIN 124

Dodaj u komandu za postavljanje admina ovako:

new adminpin = 10000 + random(89999), kod[5];
format(kod, 5, "%d", adminpin);
SendClientMessage(playerid, TVOJA_BOJA, "Dobio si admin pin: %d.", adminpin); // Postavi BOJU


Na loginu postaviš provjeru:

if(PlayerInfo[playerid][pAdmin] > 0) // Prilagodi varijablu
{
ShowPlayerDialog(playerid, DIALOG_ADMINPIN , DIALOG_STYLE_PASSWORD, "Login", "Morate unesite admin pin:", "Potvrdi", "");
return 1;
}


I napravi dialog iz kojeg ćeš očitati račune i ako fula da ga banuje,ovdje ti je dialog postavljen kao DIALOG_ADMINPIN.

BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

Pa meni je to problem, sto ne znam kako da napravim da ocita. :/

Citat: Falcon. poslato Mart 06, 2013, 19:57:44 POSLE PODNE
Pa meni je to problem, sto ne znam kako da napravim da ocita. :/

Koji sistem spremanja koristiš ?
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

Kako mogu da znam? :D

EDIT: Evo ga dialog:

if(dialogid == 3214)
{
if(!response) return Kick(playerid);
if(response)
{
if(!strcmp(inputtext, PlayerInfo[playerid][pAdminpin], false))
{
SendClientMessage(playerid, -1, "{FFFF80}MG:RP | {FFFFFF}Prosli ste proveru.");
}
else { Kick(playerid); }
//
}
return 1;
}


Isto izbacuje da je tacan kod, kada odkucam bilo koji kod, ali sad nece ni da spawna.
Poslednja Izmena: Mart 06, 2013, 20:24:40 POSLE PODNE od Falcon.