• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MySQL How to create a GM/GOD in 3 simple steps

Blue Charizard

Blue where it counts
Joined
Sep 18, 2008
Messages
345
Reaction score
0
Location
Wouldn't you like to know?
How to create a GM/GOD in 3 simple steps
By Blue Charizard
Guide created for The Forgotten Server 0.2 (Mystic Spirit)


First of all, to make it clear, this guide is created with the database-structure of TFS 0.2 and PHPMyAdmin in mind,
if you use another server revision or another database manager, this guide may or may not work for you.

It was also created with the assumption that you are using plaintext passwords, and havent changed the "a god"-group, if you use md5 or sha1 passwords, or have changed the name of the "a god"-group, this guide wont work for you.



[WARNING!]
This tutorial will help you create a GM/GOD account and character on your server.
It should ONLY be used to create accounts/characters for people who you trust, since the GM/GOD character created will be able to execute ALL server commands!
[WARNING!]



---------------------------------------------------------------

Changelog:
09-24-2008 - Created the post

---------------------------------------------------------------

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


Step 1.



First of all, log in on your PHPMyAdmin. Obviously since you have set up the database, you know how to do this, so this will not be explained.

Now, make sure you select the database that you use for your server, the most commonly used name would be "otserv".
You simply do this by clicking on the link in the leftmost part of the browser, as illustrated on this image:

dbselectkk9.png


Now, in the center of the screen, you should see a tab named "SQL":

sqltabsu6.png


Click on it.


Now, you should be in the part where you execute queries, and are now ready to proceed to step 2.



Step 2.



Okay, first of all, select the code in the codebox below, and copy it:

Code:
#--- Account Number of the GM/GOD Account ---
SET @acc = 123456;
#--------------------------------------------

#------ Password of the GM/GOD Account ------
SET @pass = "PASSWORD";
#--------------------------------------------

#------- Name of the GM/GOD Character -------
SET @name = "GM CHARACTER NAME";
#--------------------------------------------

# --- Coordinates where the character will spawn ---
SET @posx = 1000;
SET @posy = 1000;
SET @posz = 7;
#---------------------------------------------------


INSERT INTO accounts (`id`,`password`,`type`,`group_id`) VALUES (@acc,@pass,5,(SELECT `id` FROM groups WHERE `name` = 'a god'));
INSERT INTO players (`name`,`group_id`,`account_id`,`looktype`,`town_id`,`posx`,`posy`,`posz`,`save`) VALUES (@name,(SELECT `id` FROM groups WHERE `name` = 'a god'),@acc,75,1,@posx,@posy,@posz,1);
Now paste it into a texteditor of your choice, notepad works excellently.

And now we edit the variables....



#--- Account Number of the GM/GOD Account ---
SET @acc = 123456;
#--------------------------------------------


This is the account number for your GM/GOD character's account, change the number to whatever account number you want the character to have.

#------ Password of the GM/GOD Account ------
SET @pass = "PASSWORD";
#--------------------------------------------


This is the password for the GM/GOD character's account, change the text inside of the double quotes (" ") to whatever password you want.

#------- Name of the GM/GOD Character -------
SET @name = "GM CHARACTER NAME";
#--------------------------------------------


This is the GM/GOD characters name, change the text inside of the double quotes (" ") to whatever name you want on the character.

# --- Coordinates where the character will spawn ---
SET @posx = 1000;
SET @posy = 1000;
SET @posz = 7;
#---------------------------------------------------


This is the coordinates at which your GM/GOD character will spawn when you first log in. It is suggested that you change it to your temple position, so that you can log in on it.

And now we are done with the hard part, and can proceed to step 3.



Step 3.



As the final step, make sure you copy the text in your text editor by pressing CTRL + A to select it all, and then iether rightclick on it and choose "Copy" from the menu, or press CTRL + C.

Now, go to the PHPMyAdmin, and paste the text into the textbox, like this:

inputquerysa2.png


And then press the "Go" button:

querygobj9.png


Now, the site should refresh, and show a green bar stating that the query was successful:

queryokfu4.png



Congratulations, you have now created a GM/GOD character on your server!



I hope you found this guide helpful, if you have any questions, comments or requests, feel free to post them here.
 
Nice done but, got any ideas how I can change the God abilities? I mean, if i'd create a god, it's getting a GM or a CM outfit automaticlly... Is there anyway I can change it?

Because, when I change it, it doesnt change, it just remains with the GM/CM Outfit... A help would be appreciated =)
 
I had that problem too, and sadly, its in the source code that everyone with a certain account type gets iether GM or CM outfit (depending on their account type) automatically.

The only ways around this i can think of, is to either change the sourcecode and disable/edit the part which sets gm looktype on you upon login, or create an onlogin script which upon login changes your looktype to whatever you want.
 
Why it not work i just got error wen i try to click go




error.jpg
:(
 
Last edited:
Why it not work i just got error wen i try to click go
:(

From what i can see, you copied the text from the guide, not from the codebox. You are not suppose to do that, and deffinently not include those "This is the password of your ..." stuff.

You are supposed to copy only the text inside the codebox, then paste it into a text-editor like notepad, then edit the variables (in the notepad), THEN once you've edited them correctly, you copy and paste the text from NOTEPAD into PhpMyAdmin, and click go.
 
I give upp thx shit I says i dont have phpadmin accounts:(
 
Last edited:
hey, i've tried to do this.. but when i did, this came up! :(

helplol.jpg


help me pls
 
Last edited:
Error

consulta SQL: Documentación

INSERT INTO players( `name` , `group_id` , `account_id` , `looktype` , `town_id` , `posx` , `posy` , `posz` , `save` )
VALUES (
@name , (

SELECT `id`
FROM groups
WHERE `name` = 'a god'
), @acc , 75, 1, @posx , @posy , @posz , 1
);

MySQL ha dicho: Documentación
#1364 - Field 'conditions' doesn't have a default value
 
Error

consulta SQL: Documentación

#---------------------------------------------------
INSERT INTO accounts( `id` , `password` , `type` , `group_id` )
VALUES (
@acc , @pass , 5, (

SELECT `id`
FROM groups
WHERE `name` = 'a god'
)
);

MySQL ha dicho: Documentación
#1062 - Duplicate entry '400933' for key 1
 
Wrong

SQL-Asking:

#---------------------------------------------------
INSERT INTO accounts( `id` , `password` , `type` , `group_id` )
VALUES (
@acc , @pass , 5, (

SELECT `id`
FROM groups
WHERE `name` = 'a god'
)
);



MySQL Said:
#1054 - Unknown column 'type' in 'field list'
 
i have a problem, i create the character all good but when i try to enter in my ot with the account of the god i can't, help me please.
wait for a reply and thank you
 
SQL-Asking:

#---------------------------------------------------
INSERT INTO accounts( `id` , `password` , `type` , `group_id` )
VALUES (
@acc , @pass , 5, (

SELECT `id`
FROM groups
WHERE `name` = 'a god'
)
);



MySQL Said:
#1054 - Unknown column 'type' in 'field list'

HALP!!!xd
 
Back
Top