SA-MP Forums Archive
[Tutorial] [TUT] Creating a Register System using Dini - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] Creating a Register System using Dini (/showthread.php?tid=101560)

Pages: 1 2 3 4


Re: [TUT] Creating a Register System using Dini - Darnell - 13.08.2011

Define the symbol ' file '.
It needs to be defined here
pawn Code:
new cmd[256], idx, file[128], tmp[256], tmp2[256];
cmd = strtok(cmdtext, idx);



Re: [TUT] Creating a Register System using Dini - PhoenixB - 13.08.2011

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
Usefull for newbies like me!
hahaha, this made me laugh.


Re: [TUT] Creating a Register System using Dini - Kaperstone - 14.08.2011

do i need to make a folder in scriptfiles for this?
if i dont need then how i make it to save in a folder in scriptfiles?


Re: [TUT] Creating a Register System using Dini - NomNom - 19.08.2011

error 017: undefined symbol "eadmin"

Help please.


Re: [TUT] Creating a Register System using Dini - Kush - 19.08.2011

Quote:
Originally Posted by NomNom
View Post
error 017: undefined symbol "eadmin"

Help please.
Stop using this.

Start using this > https://sampforum.blast.hk/showthread.php?tid=273088


Re: [TUT] Creating a Register System using Dini - Henkie - 24.08.2011

Quote:
Originally Posted by xkirill
View Post
do i need to make a folder in scriptfiles for this?
if i dont need then how i make it to save in a folder in scriptfiles?
Somewhere, one or two times in the script is:
Code:
"%s.ini"
Change it to:
Code:
"Players/%s.ini"
@ nomnom, define eadmin as a color.
You can find that define at the first page of this topic.

=====================================

I try to save the money of the player with this code:
Code:
public OnPlayerDisconnect(playerid, reason)
{
	new file[128];
    if(IsLogged[playerid] == 1)
    {
    dini_IntSet(file, "pMoney", GetPlayerMoney(playerid));
	dini_IntSet(file, "pAdminLevel", PlayerInfo[playerid][pAdminLevel]);
	dini_IntSet(file, "pFaction", PlayerInfo[playerid][pFaction]);
	IsLogged[playerid] = 0;
	return 1;
	}
 	return 1;
}
But this code does not save the money.
How can i fix it with this system?
I don't wanna use y_ini or something like that, i just want to let it work with this system.
Please, help me :P


AW: [TUT] Creating a Register System using Dini - Santox14 - 27.09.2011

Hey i got some errors please help me

pawn Code:
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(128) : error 017: undefined symbol "eadmin"
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(135) : error 017: undefined symbol "COLOR"
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(143) : warning 225: unreachable code
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(151) : error 017: undefined symbol "COLOR"
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(163) : error 017: undefined symbol "COLOR"
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(171) : error 017: undefined symbol "AdminLevel"
C:\Users\Josh\Desktop\SA-MP Server\gamemodes\TEST.pwn(172) : error 017: undefined symbol "COLOR"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Here my script:

pawn Code:
#include <a_samp>
#include <dudb>
#include <dini>
#pragma unused ret_memcpy
new IsLogged[MAX_PLAYERS];
pawn Code:
enum pInfo
{
    Adminlevel,
    Cash,
    Vip,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, file[128], tmp[256], tmp2[256];
    cmd = strtok(cmdtext, idx);
   
    if(strcmp(cmd, "/register", true) == 0)
    {
    new name[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext, idx);
    GetPlayerName(playerid, name, sizeof(name));
    if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
    format(file,sizeof(file),"%s.ini",name);
    if(!fexist(file))
    {
    dini_Create(file);
    dini_IntSet(file, "Password", udb_hash(tmp));
    dini_IntSet(file,"AdminLevel", 0);
    dini_IntSet(file,"Cash", 0);
    SendClientMessage(playerid, eadmin, "[System]: Account Created!");
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    GetPlayerName(playerid, name, sizeof(name));
    printf("%s has registered a account!", name);
    }
    else
    {
    SendClientMessage(playerid, COLOR, " Account Already Found In Database");
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    }
    return 1;
    }
    return 0;
   
   
    if(strcmp(cmd, "/login", true) == 0)
    {
    new PlayerName[24];
    tmp = strtok(cmdtext, idx);
    if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
    new name[MAX_PLAYER_NAME];
    if(IsLogged[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR, "You already are logged in!");
    return 1;
    }
    else
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"%s.ini",name);
    if(fexist(file))
    {
    tmp2 = dini_Get(file, "Password");
    if(udb_hash(tmp) != strval(tmp2))
    {
    SendClientMessage(playerid, COLOR, "Login Failed!");
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    printf("%s has failed to login", name);
    }
    else
    {
    IsLogged[playerid] = 1;
    SetPlayerMoney(playerid, dini_Int(file, "Cash"));
    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
    SendClientMessage(playerid, COLOR, "[System]: Account Logged into!");
    }
    }
    }
    return 1;
    }
    return 0;
   
}



AW: [TUT] Creating a Register System using Dini - Santox14 - 27.09.2011

noone can help me?


Re: [TUT] Creating a Register System using Dini - Don21x - 25.12.2012

C:\Users\Deon\Downloads\Samp Servers\Crystal World of war\filterscripts\Reg.pwn(111) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Iv did this a few times untill god bless i gotten a SAMP account. So can you help me


Re: [TUT] Creating a Register System using Dini - Denying - 25.02.2013

Wow, this helped me so much, thank you very much!
I now understand the basics on dini, I think. XD


Respuesta: [TUT] Creating a Register System using Dini - RiChArD_A - 25.02.2013

How can I make my self amdin with this, so I don't have to typing /rconlogin bla bla every time I join my SV.


Re: [TUT] Creating a Register System using Dini - Joshly98 - 27.06.2013

Very nice tutorial!


Re: [TUT] Creating a Register System using Dini - freeze98 - 20.08.2014

yep it's faster