I added all you said..
pawn Код:
enum PInfo
{
Adminlevel,
Loginf,
Org
}
Under OnPlayerConnect
pawn Код:
if(Loginf == 3)
{
Kick(playerid);
return 1;
}
Under login
pawn Код:
if(dialogid==LOGIRANJE)
{
if(response==0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{FF0000} GREЉKA","{FF0000}_______________________________\n\n Odustali ste od logiranja pa\n\n ste izbaceni sa servera!\n\n_______________________________","Izadi","");
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
new Loginf = GetPVarInt(playerid, "Loginf") + 1;
SetPVarInt(playerid, "Loginf", Loginf);
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
ShowPlayerDialog(playerid,LOGIRANJE,DIALOG_STYLE_PASSWORD,"{FF0000} PRIJAVA","{00FF00}_______________________________\n\n Vaљ Acount je pronaden!\n\n Molimo unesite vaљu lozinku:\n_______________________________","Logiraj","Odustani");
SendClientMessage(playerid,CRVENA,"Unjeli ste pogreљnu lozinku!");
}
else
{
Login(playerid,inputtext); //login
return 1;
}
}
}
Stock login
pawn Код:
stock Login(playerid,key[])
{
new datoteka[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
if(!strcmp(key,dini_Get(datoteka,"Lozinka"),true))
{
UcitavanjeAcc(playerid);
SendClientMessage(playerid,CRVENA,"Ulogirani ste");
return 1;
}
else
{
SendClientMessage(playerid,CRVENA,"Unjeli ste pogreљnu lozinku!Pokuљajte ponovo!");
ShowPlayerDialog(playerid,LOGIRANJE,DIALOG_STYLE_PASSWORD,"{FF0000} PRIJAVA","{00FF00}_______________________________\n\n Vaљ Acount je pronaden!\n\n Molimo unesite vaљu lozinku:\n_______________________________","Logiraj","Odustani");
return 1;
}
}
Loading account
pawn Код:
stock UcitavanjeAcc(playerid)
{
new datoteka[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
SetPlayerScore(playerid,dini_Int(datoteka,"Level"));
GivePlayerMoney(playerid,dini_Int(datoteka,"Novac"));
IgracInfo[playerid][Adminlevel]=dini_Int(datoteka,"Adminlevel");
IgracInfo[playerid][Org]=dini_Int(datoteka,"Org");
IgracInfo[playerid][LoginF]=dini_Int(datoteka,"Loginf");
return 1;
}
Saving acc
pawn Код:
stock SpremanjeAcc(playerid)
{
new datoteka[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(datoteka,sizeof(datoteka),"/korisnici/%s.txt",name);
dini_IntSet(datoteka,"Level",GetPlayerScore(playerid));
dini_IntSet(datoteka,"Novac",GetPlayerMoney(playerid));
dini_IntSet(datoteka,"Adminlevel",IgracInfo[playerid][Adminlevel]);
dini_IntSet(datoteka,"Org",IgracInfo[playerid][Org]);
dini_IntSet(datoteka,"Loginf",IgracInfo[playerid][Loginf]);
return 1;
}
Reset variable
pawn Код:
stock ResetVar(playerid)
{
IgracInfo[playerid][Adminlevel]=0;
IgracInfo[playerid][Org]=0;
IgracInfo[playerid][Loginf]=0;
return 1;
}
And it gives me the folowing warnings;
gamemode1.pwn(92) : warning 213: tag mismatch
gamemode1.pwn(92) : warning 205: redundant code: constant expression is zero
pawn Код:
if(Loginf == 3) //this line
{
Kick(playerid);
return 1;
}
gamemode1.pwn(299) : warning 219: local variable "Loginf" shadows a variable at a preceding level
gamemode1.pwn(300) : warning 213: tag mismatch
gamemode1.pwn(299) : warning 204: symbol is assigned a value that is never used: "Loginf"
pawn Код:
if(dialogid==LOGIRANJE)
{
if(response==0)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"{FF0000} GREЉKA","{FF0000}_______________________________\n\n Odustali ste od logiranja pa\n\n ste izbaceni sa servera!\n\n_______________________________","Izadi","");
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
new Loginf = GetPVarInt(playerid, "Loginf") + 1; // line 299
SetPVarInt(playerid, "Loginf", Loginf); //line 300
for(new i = 0; i < 50; i++) SendClientMessageToAll(BIJELA," ");
ShowPlayerDialog(playerid,LOGIRANJE,DIALOG_STYLE_PASSWORD,"{FF0000} PRIJAVA","{00FF00}_______________________________\n\n Vaљ Acount je pronaden!\n\n Molimo unesite vaљu lozinku:\n_______________________________","Logiraj","Odustani");
SendClientMessage(playerid,CRVENA,"Unjeli ste pogreљnu lozinku!");
}
else
{
Login(playerid,inputtext); //login
return 1;
}
}
}