SA-MP Forums Archive
Am I retarded or what.. - 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: Am I retarded or what.. (/showthread.php?tid=643054)



Am I retarded or what.. - Prokill911 - 12.10.2017

Hey, So I've recently come back to samp after 2 n half years and I fucking hate DINI like with a passion, If this was SQL It'd be piece of cake..

But for some reason, this command DOES not work and I can't figure out why not.
PHP код:
CMD:unban(playeridparams[]) {
    if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid)) {
        new 
name[(MAX_PLAYER_NAME*2)+1];
        if(!
sscanf(params"s[128]"name)) {
            new 
name2[128];
            
format(name2sizeof(name2), "%s"name);
            if(
udb_Exists(name2) && PlayerInfo[playerid][LoggedIn] == 1) {
                new 
file[128];
                
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(name2) );
                new 
isbanned dini_Int(file"banned");
                if(
isbanned == 1) {
                    
dUserSetINT(name2).("banned",0);
                    new 
msg[128];
                    
format(msgsizeof(msg), "%s has been unbanned"name2);
                    
SendClientMessage(playerid, -1msg);
                } else {
                    
SendClientMessage(playerid, -1"This player is not banned!");
                }
            } else {
                
SendClientMessage(playerid, -1"Player not found, no ban removed!"); //Always exits too this line
                
return 1;
            }
        } else {
            
SendClientMessage(playerid, -1"USAGE: /unban [accountname]");
        }
    }
    return 
1;

Now, If I unban lets say "Prokill" it will work it lets me unban that account, but now if I change that name too; Prokill_ Or Prokill_123
The second I add that underscore It all goes too shit..
Anyone have any ideas?

Edit:
Found out that when a user registers for example: Test_Test, It saves it as "Test_00Test" same with [Test] "00Test00".. can't find why or where it's doing this


Re: Am I retarded or what.. - Luke_James - 12.10.2017

Convert it to SQL then? dini is redundant.


Re: Am I retarded or what.. - Prokill911 - 12.10.2017

The entire script is Dini and i aint got time or patience to sit an do that lol.


Re: Am I retarded or what.. - Luis- - 12.10.2017

It’d be worth converting in the long run, trust me. I know it’ll be a pain, i’ve done it myself.