[Tutorial] Login and Register System - Dialogs - Using Y_INI
#61

EDIT: Nevermind, gamemode received*.
Reply
#62

I sent you the full script in a Pm, its still giving errors.
Reply
#63

Quote:
Originally Posted by SantarioLeone
View Post
I sent you the full script in a Pm, its still giving errors.
Gamemode sent. Fixed.
Reply
#64

When i conenct it says my Y_ini is working, but when i /q there are no player files in the Users folder.
Reply
#65

Did you manually create a folder called Users in the scriptfiles and are you sure the script is valid and not missing some saving functions?
Reply
#66

I'm having some problems. I downloaded your "full package" but when I run it, it doesn't really work... I log on and it asks me to register so i enter a password. Then when the server restarts, it asks me to re-create my account. I looked in the scriptfile/users directory and it seems that the .ini files are not being created.

Note: I have not editted anything in the script...
Reply
#67

Quote:
Originally Posted by Coffeemonster
View Post
Did you manually create a folder called Users in the scriptfiles and are you sure the script is valid and not missing some saving functions?
Yes i have manually created the folder "Users" and that didnt work, i even tried to redefine the saving path, to a new folder, "UserData" but that didnt work either. and the script complies perfectly. But it just wont save any data.
Reply
#68

Hey I need help, I just converted my shit to DINI, but I don't know how to convert my admin commands to YINI, please help


pawn Code:
/*==============================================================================
    =============================ADMIN COMMANDS!====================================
    ================================================================================*/

   
    COMMAND:setadminlevel(playerid,params[])
    {
            new adminlevel,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
            new tmp[256], tmp2[256], Index,str[50];// creating the new variables
            tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),adminlevel = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
            GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
            format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file
            if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You are not an RCON admin!");//if the player is not rcon admin
            if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setlevel <ID> <Level>");// if the string is empty
            if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected
            PInfo[id][ADMINLEVEL] = adminlevel;//sets the level of the player
            INI_WriteInt(file,"Admin Level",adminlevel);//saves the new level to the file
            format(str,sizeof(str),"You have set %s's level to %d",n,adminlevel);//creates the string
            SendClientMessage(playerid,COLOR_LIGHTBLUE,str);
            return 1;
    }
    COMMAND:setfaction(playerid,params[])
    {
            new faction,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
            new tmp[256], tmp2[256], Index,str[50];// creating the new variables
            tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),faction = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
            GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
            format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file
            if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You are not an RCON admin!");//if the player is not rcon admin
            if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setfaction <ID> <Level>");// if the string is empty
            if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected
            PInfo[id][FACTION] = faction;//sets the level of the player
            INI_WriteInt(file,"Faction",faction);//saves the new level to the file
            format(str,sizeof(str),"You have set %s's faction to %d",n,faction);//creates the string
            SendClientMessage(playerid,COLOR_LIGHTBLUE,str);
            return 1;
    }
    COMMAND:kick(playerid,params[])
    {
            new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
            new tmp[256], Index, str[49];
            tmp = strtok(params,Index), id = strval(tmp);
            GetPlayerName(id,on,sizeof(on));
            GetPlayerName(playerid,n,sizeof(n));
            if(PInfo[playerid][LEVEL] < 3) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 3 to use this command!");
            if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /kick <ID> ");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID");
            format(str,sizeof(str),"%s has kicked %s",n,on);
            SendClientMessageToAll(COLOR_LIGHTBLUE,str);
            Kick(id);
            return 1;
    }
    COMMAND:ban(playerid,params[])
    {
            new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
            new tmp[256], Index, str[49];
            tmp = strtok(params,Index), id = strval(tmp);
            GetPlayerName(id,on,sizeof(on));
            GetPlayerName(playerid,n,sizeof(n));
            if(PInfo[playerid][LEVEL] < 3) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 3 to use this command!");
            if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /ban <ID> ");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID");
            format(str,sizeof(str),"%s has banned %s",n,on);
            SendClientMessageToAll(COLOR_ORANGE,str);
            Ban(id);
            return 1;
    }
Compile Error:
pawn Code:
C:\Documents and Settings\RockingCamman\Desktop\RealityC Roleplay\gamemodes\RealityC.pwn(399) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\RockingCamman\Desktop\RealityC Roleplay\gamemodes\RealityC.pwn(415) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#69

I can't login It says "You have entered an incorrect password"
https://sampforum.blast.hk/showthread.php?tid=343073&page=2
Y_Less, do something!
Reply
#70

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
I can't login It says "You have entered an incorrect password"
https://sampforum.blast.hk/showthread.php?tid=343073&page=2
Y_Less, do something!
Same with me Y_Less. We need you here.
Reply
#71

I think it needs to be update
Reply
#72

Everything is working fine, I followed the Tutorial form start to the end, i have ONLY 1 Q...

Is it really important to relog after register or you can continue playing ?
Reply
#73

Quote:
Originally Posted by Bokyyy
Посмотреть сообщение
Everything is working fine, I followed the Tutorial form start to the end, i have ONLY 1 Q...

Is it really important to relog after register or you can continue playing ?
You can continue playing but once you will leave the server and come back. It will say that you have entered an invalid/wrong password.
Reply
#74

Ummmmm help ...

D:\samp03e_svr_win32\gamemodes\FAILS.pwn(143) : error 017: undefined symbol "UserPath"
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(145) : error 017: undefined symbol "UserPath"
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(157) : error 017: undefined symbol "UserPath"
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(160) : error 017: undefined symbol "PlayerInfo"
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(160) : warning 215: expression has no effect
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(160) : error 001: expected token: ";", but found "]"
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(160) : error 029: invalid expression, assumed zero
D:\samp03e_svr_win32\gamemodes\FAILS.pwn(160) : fatal error 107: too many error messages on one line

PLS help.
Reply
#75

Y_Less said himself that nothing has changed with y_ini, but clearly for me and a lot of other people it's been very glitchy. (INI_ParseFile is not parsing files.) I've given up on ini systems, and I recommend trying to learn the native SQLite. There are tons of great tutorials on how to use it.
Reply
#76

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Y_Less said himself that nothing has changed with y_ini, but clearly for me and a lot of other people it's been very glitchy. (INI_ParseFile is not parsing files.) I've given up on ini systems, and I recommend trying to learn the native SQLite. There are tons of great tutorials on how to use it.
I have done the same,
I find it allot easier to use sqlite
Although I made the change before 0.3e so never experienced any ini issues,


I made a small api to update my users table,
was just a few different querys with some arguments and I had a full add/edit/delete
for my hole player enum. (Around 35 fields)
and moved all my vehicles, map icons, objects, ect.. to the db.
still working out the add/edit/delete in some systems
but for the most part i think this was allot faster than any ini system
as far as writing code/debugging it and making it work!
Reply
#77

So Y_INI is fixed now Alex?

@Johnny - I agree to all that too. Hope i get to learn SQLite natives quickly. Fucked up between queries.
Reply
#78

It`s working fine but i need when a player joins for first time to spawn on the airport.And when he bought a house to spawn him in his house.Im sorry im new in scripting and i don`t know english too well.
Reply
#79

Thank you very much!
Reply
#80

The best script ever ! OmG thanks very much !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)