Having trouble converting
#1

pawn Код:
if(dialogid == dlogin)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(strcmp(hashpass,PlayerInfo[playerid][Ppassword]))
            {
                SetPlayerScore(playerid,PlayerInfo[playerid][Pscore]);
                GivePlayerMoney(playerid,PlayerInfo[playerid][Pmoney]);
                SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");
            }
            else if(!strcmp(hashpass,PlayerInfo[playerid][Ppassword]))
            {
                ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password
                return 1;
            }
        }
    }
Hi im having trouble converting this from Yini to dini can someone help

Please no one ask why im making it dini becuase yini faster etc etc i find dini better
Reply
#2

pawn Код:
if(dialogid == dlogin)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(strcmp(hashpass,PlayerInfo[playerid][Ppassword]))
            {
                SetPlayerScore(playerid,dini_Int(UserPath(playerid), "Score"));
                GivePlayerMoney(playerid,dini_Int(UserPath(playerid), "Money"));
                SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");
            }
            else if(!strcmp(hashpass,PlayerInfo[playerid][Ppassword]))
            {
                ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password
                return 1;
            }
        }
    }
Like this? If you want, here is nice Dini tutorial : https://sampforum.blast.hk/showthread.php?tid=308390
Reply
#3

I got this error
Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2048) : error 001: expected token: "-string end-", but found "-identifier-"

Compilation aborted.Pawn compiler 3.2.3664
Reply
#4

Ok now i got these :/ dunno what i did wrong :/
Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2019) : error 076: syntax error in the expression, or invalid function call
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2020) : error 035: argument type mismatch (argument 3)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2029) : error 035: argument type mismatch (argument 3)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 012: invalid function call, not a valid address
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : warning 215: expression has no effect
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 001: expected token: ";", but found ")"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Line 2019
pawn Код:
dini_Set(Path,"Ppassword",hashpass);
Line 2020
pawn Код:
dini_IntSet(path, "Username", PlayerName(playerid));
Line 2029
pawn Код:
dini_IntSet(path, "Register date", string);
Line 2054
pawn Код:
SetPlayerScore(playerid,dini_Int(UserPath(playerid), "Score"));
Reply
#5

You must re-write this all... Look at Dini tutorials
Reply
#6

Quote:
Originally Posted by lamarr007
Посмотреть сообщение
You must re-write this all... Look at Dini tutorials
wha? i was following https://sampforum.blast.hk/showthread.php?tid=308390
Reply
#7

Ok ive managed to get it down to the errors on line 2054
pawn Код:
SetPlayerScore(playerid,dini_Int(UserPath(playerid)), "Score");
Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : warning 215: expression has no effect
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 001: expected token: ";", but found ")"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

Sorry if I won't be of much help but Dini is in no aspect better than yini! When I say no aspect that's what I mean by it, I see no reason for you or anyone else to convert it back to Dini. Trust me on this, when you have a few people on your server, and it's loading stuff with Dini you'll be slapping yourself against your head for ever stepping away from an updated file system.
Reply
#9

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : warning 215: expression has no effect
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 001: expected token: ";", but found ")"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2054) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
You mean this errors?
Reply
#10

Yes those
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)