[Tutorial] Making an Admin Script with dini!
#21

Nice Tuturial.
Begginers can learn alot from it.
Reply
#22

Quote:
Originally Posted by TheGuardianAngel
View Post
good job , nice tutorial
Quote:
Originally Posted by Ironboy500[TW]
View Post
Nice Tuturial.
Begginers can learn alot from it.
Thanks Guys !
Reply
#23

lol this is epic really, i already made these.

pawn Code:
dcmd(register,8,cmdtext);
    dcmd(login,5,cmdtext);
    dcmd(setlevel,8,cmdtext);
    dcmd(kick,4,cmdtext);
    dcmd(ban,3,cmdtext);
    dcmd(freeze,6,cmdtext);
    dcmd(unfreeze,8,cmdtext);
    dcmd(testcmds,8,cmdtext); //This command it to write down what commands i need to test ingame because i forget a lot D:
    dcmd(explode,7,cmdtext);
    dcmd(goto,4,cmdtext);
    dcmd(get,3,cmdtext);
    dcmd(slap,4,cmdtext);
    dcmd(giveweapon,10,cmdtext); // Fixing this command now.
    dcmd(setcash,7,cmdtext);
    dcmd(setcolour,9,cmdtext);
    dcmd(pm,2,cmdtext);
    dcmd(m,1,cmdtext);
    dcmd(reply, 5, cmdtext);
    dcmd(r, 1, cmdtext);
    dcmd(nopm, 4, cmdtext);
Reply
#24

Not bad explained, but could be a li'l bit better. Also, take a look at Y_Less's code optimization threads, especially this one: https://sampforum.blast.hk/showthread.php?tid=55261

Overall, good job.
Reply
#25

Thanks alot Hiddos, I thought I was suppose to use 256 cell strings for the files, I read in I think Y-Less' topic about why not to use 256 he mentioned the only time that you should use 256 cell strings was when reading from a file.

@willsuckformoney

Thanks man will you be releasing it sometime?
Reply
#26

Maybe, if I do it will be sometime next week, version 1 ofc.
Reply
#27

Quote:
Originally Posted by homijs
Посмотреть сообщение
Thanks..khmm peoples like me need more tuts like this
wiki.sa-mp.com
ktnx
Reply
#28

pawn Code:
if (level > 5) return 0;
5 being the maximum level possible, if the level entered is more then 5, it cancels any script past that point.

Just add that under the setlevel command.
Reply
#29

Quote:
Originally Posted by PinkFloydLover
View Post
pawn Code:
if (level > 5) return 0;
5 being the maximum level possible, if the level entered is more then 5, it cancels any script past that point.

Just add that under the setlevel command.
I asked that question a while back :P But thank you sir. Also, i switched to Y_INI which is way faster
Reply
#30

Nice work
Reply
#31

Nice but how can i add Reason to kick and ban
like:

Code:
/Kick <ID> <REASON>
/Ban <ID> <REASON>
Reply
#32

Fairly useful, but on OnPlayerCommandText, don't you need to add, something like "dcmd_COMMAND(playerid, " or someting?
Reply
#33

Quote:
Originally Posted by shayan122
View Post
Nice but how can i add Reason to kick and ban
like:
Use SSCANf, if you want to do it this way:
pawn Code:
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, -1, "USAGE: /Kick <ID> <REASON>
Reply
#34

i don't under stand.. everything works fine just when i goto login it says your account isn't register but yet it is.. any help
Reply
#35

Look at the topic date..: 06/09/2010, 07:10 AM
Plus, dini is now outdated.
Reply
#36

ok i fixed it
Reply
#37

You could've done this:
pawn Code:
new checkname[128];
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(checkname, 128, "Users/%s.ini", playerName);
if(!fexists(checkname)) {
    // Player has not register.... Code Here.
} else {
    // Player has already register.. Code here.
Reply
#38

I compiled after I made the /register and /login commands, but I got this:

pawn Code:
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\TestCode.pwn(99) : warning 217: loose indentation
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\TestCode.pwn(99) : error 029: invalid expression, assumed zero
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\TestCode.pwn(99) : error 017: undefined symbol "reason"
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\TestCode.pwn(99 -- 101) : error 029: invalid expression, assumed zero
C:\Users\Gast\Desktop\SA-MP Server\gamemodes\TestCode.pwn(99 -- 101) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Here are my lines at the OnPlayerDisconnect:

pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
new n[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid,n,sizeof(n));
    format(file,sizeof(file),"MyAdmin/Users/%s.txt",n);
    PInfo[playerid][Logged] = 0;
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Logged",0);
        return 1;
    }
What went wrong? I know it's outdated and stuff, but its the first language I actually understand.
Reply
#39

Nice tut dude !!
Helped me alot with my admin system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)