Nothing is saved :/
#1

I use dudb

and this for register and login
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_LOGIN)
    {
        if (
response == 0)
        {
            
SetTimer("Kickplayer",700,0);
            
Kick(playerid);
               return 
1;
        }
        if (
response == 1)
        {
            if (
strlen(inputtext) == 0)
            {
                
SendClientMessage(playerid,COLOR_ERROR,"Please enter your password for your account in the box below.");
                
ShowLoginScreen(playerid);
                return 
1;
            }
            if (
udb_CheckLogin(PlayerName(playerid),inputtext))
            {
                
AdminLevel[playerid] =dUserINT(PlayerName(playerid)).("Adminlevel");
                   
Coins[playerid] =dUserINT(PlayerName(playerid)).("Coins");
                
SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("Score")-GetPlayerScore(playerid));
                
NameBanned[playerid] =dUserINT(PlayerName(playerid)).("Nameban");
                   new 
pIp[16];
                
GetPlayerIp(playeridpIpsizeof(pIp));
                
dUserSet(PlayerName(playerid)).("IP"pIp);
                   
PLAYERLIST_authed[playerid]=true;
                  return 
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully logged in! Your previous stats have been restored.");
            }
            
ShowLoginScreen(playerid);
            
CheckPasswordAttempts(playerid);
        }
        return 
1;
    }
    if(
dialogid == DIALOG_REGISTER)
    {
        if (
response == 0)
        {
            
Kick(playerid);
            return 
1;
        }
        if (
response == 1)
        {
            if (
udb_Exists(PlayerName(playerid)))
            {
                
SendClientMessage(playerid,COLOR_ERROR,"This account already exists, please choose a different player name.");
                return 
1;
            }
            if (
strlen(inputtext)==0)
            {
                
SendClientMessage(playerid,COLOR_ERROR,"Please enter your password in the box to register in this server.");
                
ShowRegisterScreen(playerid);
                return 
1;
            }
            if (
udb_Create(PlayerName(playerid),inputtext))
            {
                
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have registered, now please enter your password in the box to login.");
                
ShowLoginScreen(playerid);
                
PLAYERLIST_authed[playerid]=true;
                
dUserSetINT(PlayerName(playerid)).("Coins",0);
                
dUserSetINT(PlayerName(playerid)).("Score",0);
                
dUserSetINT(PlayerName(playerid)).("Adminlevel",0);
                
dUserSetINT(PlayerName(playerid)).("Nameban",0);
                new 
pIp[16];
                
GetPlayerIp(playeridpIpsizeof(pIp));
                
dUserSet(PlayerName(playerid)).("IP"pIp);
            }
            return 
true;
        }
        return 
1;
    }
    return 
0;

And this command for example to set player admin's level

PHP код:
dcmd_setadmin(playerid,params[])
{
    new 
ID;
    new 
cmdreason;
    if(
sscanf(params,"ui",ID,cmdreason))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /setadmin (ID) (Level)");
        
SendClientMessage(playerid,COLOR_LIME,"It will set admin level");
        return 
1;
    }
    
AdminLevel[ID] =cmdreason;
    
SendClientMessage(playerid,COLOR_SEXYGREEN,"An Admin has set your level bla bla bla");
    return 
1;

But nothing are saved in the folder of players file
Reply
#2

anyone know how to solve this , Sorry for BUMP , But i wanna know if i will complete scripting or to stop
Reply
#3

please i really need help in this..
Reply
#4

Post your function which saves the players' userdata.
Reply
#5

Is the problem in the dialogs or the problem in the include itself ?
Reply
#6

EDIT: My mistake.
Reply
#7

pawn Код:
CMD:setlevel(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 4) return SCM(playerid, -1, "Your Not an Admin!");
    if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setlevel [ID] [Level 1-5]");//it will show this if you dont use the format properly
    if(levels > 5) return SendClientMessage(playerid,0xFF0000FF,"LEVELS AVAILABLE 1-5!");//Available levels
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid,1,"{F81414}That user is not connected.");//Detect if the id/partofname is connected
    if(PlayerInfo[ID][pAdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!");//Detect if the guy is already the level you setted
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);//define the other person name
    if(levels == 0)
    {
        format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,levels);
        SendClientMessage(ID,0xFF9900AA,str);
        format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
        SendClientMessage(playerid,0xFF9900AA,str);
        PlayerInfo[ID][pAdminLevel] = levels;
        return 1;
    }
    format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,levels);
    SendClientMessage(ID,0xFF9900AA,str);
    format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
    SendClientMessage(playerid,0xFF9900AA,str);
    PlayerInfo[ID][pAdminLevel] = levels;
    return 1;
}
try this edit it to your UserData
Reply
#8

Quote:
Originally Posted by AmsterdamCopsAndRobbers
Посмотреть сообщение
pawn Код:
CMD:setlevel(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 4) return SCM(playerid, -1, "Your Not an Admin!");
    if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setlevel [ID] [Level 1-5]");//it will show this if you dont use the format properly
    if(levels > 5) return SendClientMessage(playerid,0xFF0000FF,"LEVELS AVAILABLE 1-5!");//Available levels
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid,1,"{F81414}That user is not connected.");//Detect if the id/partofname is connected
    if(PlayerInfo[ID][pAdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!");//Detect if the guy is already the level you setted
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);//define the other person name
    if(levels == 0)
    {
        format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,levels);
        SendClientMessage(ID,0xFF9900AA,str);
        format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
        SendClientMessage(playerid,0xFF9900AA,str);
        PlayerInfo[ID][pAdminLevel] = levels;
        return 1;
    }
    format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,levels);
    SendClientMessage(ID,0xFF9900AA,str);
    format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
    SendClientMessage(playerid,0xFF9900AA,str);
    PlayerInfo[ID][pAdminLevel] = levels;
    return 1;
}
try this edit it to your UserData
I'm using dudb , this is the problem , that dudb don't save in the user files
Reply
#9

Damn code is riddled with useless returns.... anyways post your saving routine.
Reply
#10

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Damn code is riddled with useless returns.... anyways post your saving routine.
I use dudb http://pastebin.com/17bLGwhd
it saves in a folder named by SFCRRPG , and as shown the dialogs in the main topic that line
PHP код:
if (udb_CheckLogin(PlayerName(playerid),inputtext))
            {
                
AdminLevel[playerid] =dUserINT(PlayerName(playerid)).("Adminlevel"); 
so when i use
PHP код:
AdminLevel[ID] =3
it must make in the file that Admin Level is 3

but it still 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)