SA-MP Forums Archive
Having trouble converting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Having trouble converting (/showthread.php?tid=368489)



Having trouble converting - thefatshizms - 13.08.2012

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


Re: Having trouble converting - lamarr007 - 13.08.2012

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


Re: Having trouble converting - thefatshizms - 13.08.2012

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



Re: Having trouble converting - thefatshizms - 13.08.2012

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"));



Re: Having trouble converting - lamarr007 - 13.08.2012

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


Re: Having trouble converting - thefatshizms - 13.08.2012

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


Re: Having trouble converting - thefatshizms - 13.08.2012

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.



Re: Having trouble converting - playbox12 - 13.08.2012

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.


Re: Having trouble converting - lamarr007 - 13.08.2012

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?


Re: Having trouble converting - thefatshizms - 13.08.2012

Yes those