Cash = 0
Scores = 0
Password = 248251233
Kills = 0
Deaths = 0
Admin Level = 3
VIP Level = 0
Cash = 0
Scores = 0
Password = 248251233
Kills = 0
Deaths = 0
Admin Level = 3
VIP Level = 0
Admin Level = 0
VIP Level = 0
if(dialogid == DIALOG_LOGIN)
{
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid),"LoadUser_data", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScores]);
SendClientMessage(playerid,COLOR_GREEN,"[INFO]:You have logged in!");
Logged[playerid] = 1;
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Please Login!","Type your password below to login","Login","Leave");
}
}
if(!response) return Kick(playerid);
}
Mind showing us some more things about this ? There is might be something wrong with the command 'setlevel', show your full script related to this.
|
CMD:setadmin(playerid,params[])
{
new targetid,level,Name[MAX_PLAYER_NAME],Name2[MAX_PLAYER_NAME],str[128],str2[128];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]:You Need to be RCON Admin to do this command!");
if(sscanf(params,"ui",targetid,level))return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]:Usage:/setadmin ID Level");
if(PlayerInfo[playerid][pAdmin] == level)return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]:Player selected is already on that Level!");
if(level >6)return SendClientMessage(playerid,COLOR_BRIGHTRED,"[ERROR]:Available Level 1-6!");
GetPlayerName(playerid,Name,sizeof(Name));
GetPlayerName(targetid,Name2,sizeof(Name2));
format(str,sizeof(str),"Administrator %s[%d] has promoted %s[%d] to admin level %i",Name,playerid,Name2,targetid,level);
SendClientMessageToAll(COLOR_PINK,str);
PlayerInfo[targetid][pAdmin] = level;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)&&IsPlayerAdmin(i)||PlayerInfo[i][pAdmin] >=1)
{
format(str2,sizeof(str2),"Admin %s[%d]has used /setadmin command!",Name,playerid);
SendClientMessage(i,COLOR_ORANGE,str);
}
}
return 1;
}
CMD:setlevel(playerid, params[])
{
new id, level, string[128], string2[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, "Nono:You don't have the required level to execute this command");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Nana: use /setlevel [ID] [level]");
if(level > 6) return SendClientMessage(playerid, -1, "No: Level cant be above 6");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "No: That ID isn't connected");
else
{
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, name2, sizeof(name2));
pInfo[id][Adminlevel] = level;
format(string, sizeof(string), "Admin %s has promoted you to admin level %d", name, level);
format(string2, sizeof(string2), "You have promoted %s to admin level %d", name2, level);
SendClientMessage(id, -1, string);
SendClientMessage(playerid, -1, string2);
}
return true;
}
try this with that cmd
pawn Код:
i guess that the problem is in register dialog show me the regiter dialog pls |
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!strlen(inputtext))return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Please Register your account here!","Type your password to make one your account!","Register","Leave");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Data");
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Scores",0);
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Admin Level",0);
INI_WriteInt(File,"VIP Level",0);
INI_Close(File);
SendClientMessage(playerid,COLOR_GREEN,"[INFO]:You Have succesfully registered!");
Logged[playerid] = 1;
}
if(!response)return Kick(playerid);
}
Show your saving thing, you are saving it on OnPlayerDisconnect I'm sure. Show the script related to saving functions not all!
|
public OnPlayerDisconnect(playerid,reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Scores",GetPlayerScore(playerid));
INI_WriteInt(File,"VIP Level",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKill]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeath]);
INI_Close(File);
return 1;
}
This is the register dialog:
pawn Код:
This is the related functions in saving stuff: pawn Код:
|
public OnPlayerDisconnect(playerid,reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Scores",GetPlayerScore(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKill]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeath]);
INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"VIP Level",PlayerInfo[playerid][pVip]);//must be like "onplayerdisconnect" or will save twice and different !
INI_Close(File);
return 1;
}
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!strlen(inputtext))return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Please Register your account here!","Type your password to make one your account!","Register","Leave");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Scores",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Admin Level",0);
INI_WriteInt(File,"VIP Level",0);
INI_Close(File);
SendClientMessage(playerid,COLOR_GREEN,"[INFO]:You Have succesfully registered!");
Logged[playerid] = 1;
}
if(!response)return Kick(playerid);
}
aja !
eureca ! theres your problem ! you must sort it nothin' more add this in onplayer disconnect [pawn] pawn Код:
pawn Код:
|
Still re writing again :/ Ive typed exaclty the codes that you gave. But still not fixed :/ Please help me |