Jump to content

Recommended Posts

Posted

Hello, i will teach u something usefull today

Look at this table: http://imageshack.us/photo/my-images/191/imagenqg.png/ lets say left table is named "characters" and right table is named "clans"

SELECT

Ok so lets do something easy, lets take all variables from online characters:

SELECT * FROM characters WHERE online=1

* means every column(ID, name, title etc), so thats easy right?

 

So now lets get every online character with the clan

SELECT * FROM characters WHERE online=1 AND clanId>0

Thats easy too, we will have 2 results

 

Now we will take every Name of the character, but i want them sorted by PvpPoints, so character with most pvp points will be at first place:

SELECT Name FROM characters ORDER BY PvpKills ASC

We will have "Vampir, Koko, Tester, PolakPl" as result. ASC - means from a to z/lowest to biggest, DESC means from z-a/biggest to lowest.

 

Hmm and what if i want to take just top 3 guys?

SELECT TOP 3 Name FROM characters ORDER BY PvpKills ASC

Thats simple :P

 

Ok, now lets take Titles of characters, that have got clan, or their sex is 1

SELECT Title FROM characters WHERE clanId>0 OR Sex=1

Piece of cake

 

We have got some different things also, like taking average:

SELECT AVG(PkKills) FROM characters

It will give us: 12, since (4+12+0+32)/4=12

You can also look at Count(), Max(), Min(), Sum()

 

Sometimes it happends, that we need to get 2 tables in same time, like for example get name of player's clan, and its not in same table, so thats a bit harder:

SELECT clans.Name, characters.Name FROM characters INNER JOIN clans ON characters.clanId=clans.clanId WHERE characters.clanId>0

Thats a bit complicated, isnt it? So we are taking Name from table clans and Name from table characters.

We need to connect tables, so after FROM we put name of first table, later INNER JOIN and after that name of 2nd table.

After that we put word ON and choose columns that are connected(here clanId, sometimes we may have in characters char_id and in other table also char_id, so thats what we need to connect), so we do it like this: table.column_name=2ndTable.2ndColumn_name

Column names doesnt have to be different!

 

UPDATE

Ok, lets leave that boring SELECT, i will also teach u how to update, add and remove records.

UPDATE characters SET PvpKills=PvpKills+1

It will add 1 pvp Point to every character in database.

So first UPDATE, later name of the table, later SET and what we wanna do

 

UPDATE characters SET Title='' WHERE clanId=0

This will set every character title empty, if he doesnt have a clan.

 

Insert

Now lets add some new Records

INSERT INTO clans VALUES (19,'Losers', 1, 0, '', 0, 0)

Ok so i added new Clan to clans table, id=19, name=Losers, level=1, reputation=0, ally name is empty, castle and fortress is set to 0

 

if we want to put only some values and make the rest be default, do this:

INSERT INTO clans(clanId, Name, Level) VALUES (20, 'NewClan', 2)

So clanId will be 20, name=NewClan, and level=2, rest will be set to default so it will probably be null or 0

 

DELETE

The last thing will be deleting records.

DELETE FROM clans WHERE hasCastle=0

it will remove all clans, that doesnt have castle.

 

What if we wanna remove everything?

DELETE FROM clans

 

Thats all, thx for reading it, i know its very basic thing but maybe somebody will find it usefull, if u wanna learn more http://www.w3schools.com/sql/

Feel free to ask about anything :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • try this one instead. The one he shared affects every single NPC/player character in the game, the one I posted only affects player characters  https://drive.google.com/file/d/1UtccbD9e50x3WEnQBab2PTZnBHwpcGYM/view?usp=sharing or perhaps i misunderstood; if you could please post a full explanation of the problem you're having with the files, unfortunately i think whatever you're using to translate to english is a bit bad nevermind, i got what you mean, here's the fix   https://drive.google.com/file/d/1av7OHaGSdnVQtcBgb9MhtiIkxVXy3P2y/view?usp=sharing   CanIngnoreCollision=True CanBeIngnoredCollision=True  
    • <dailyReward days="28" autoOpen="true" minimumOnlineTimeSeconds="30" oneRewardPerIP="true" resetIfMissDay="true">   For now, I have these settings in the XML—this is the V1 version I created, though I plan to make further improvements over time. Of course, I’ll also add more protections—MAC, HWID, and perhaps others like account-based restrictions—to make it more secure. We can also implement non-tradable items to further enhance the system's security. I’ll keep posting updates and refining both the system and the interface. I might make a video tomorrow; if you look at the top, you'll see the "auto-open" feature can be toggled on or off, allowing users to rely solely on the `.daily` command. Cheers! Note: If I sell it in this state, I’ll provide support and roll out updates to users. I’m not forcing anyone to buy anything; I’d even provide the patch files so that anyone with the necessary skills can add features, modify it, or improve it further.
    • If the problem is that the target is lost, the action of aiming at another character, upon losing collision, does not allow aiming.   This one works as it should, allowing you to target characters
    • MICROTEXT AND WATERMARKS BREAK MOST RENDERINGS Microtext and watermarks aren’t just small decorative details. They are one of the most common reasons a document fails verification, even when it looks decent at first glance. The issue is that these elements are almost impossible to reproduce “by eye.” Microtext requires precise geometry and legibility at a very small size, while a watermark needs the correct density, transparency, and accurate placement relative to other security features. Any deviation becomes obvious during detailed inspection. ▪ What’s most often done wrong: - microtext is drawn too thick or blurry - the watermark is made either too visible or almost invisible - the positioning between microtext and watermark is ignored - the original printing technology isn’t taken into account when choosing density and shape - The stronger the document’s security features, the less room there is for approximation. What matters here isn’t visual similarity, but accurate reproduction of the original technical characteristics. If your document contains microtext and watermarks, this is always an area that requires extra attention. Write to us in DMs. We’ll review your case and point out exactly which details need the highest precision during rendering. › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #drawing #microtext #photoshop #editing #watermarks
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..