![]() |
Client Flags Limit
The hat system on Lexia uses client flags to store your hats. This seemed fine, until the client flag stopped accepting more hats since there is a limit on how many items a client flag could contain. I now want to store it in a database NPC. Obviously, this would change most of the hat system, so does anybody have any ideas, or alternatives to using an NPC? The hat system script is below.
PHP Code:
|
It's better to avoid to using long amounts of data in client flags because they get truncated/cut-off in external RC.
You could store them like this: clientr.hat.Egghat = "hat2.png"; Then to display them: PHP Code:
PHP Code:
player.addHat("Egg Hat", "hat2.png"); This is basically an item system. |
I already use a public function for adding hats...
PHP Code:
|
Quote:
Also why aren't you just using it like a normal array: client.hats.add(hatname); |
Quote:
|
Hey, i'm not ignoring what you guys are saying, but exploring other methods. I am using a DB-NPC called HatStorage, and storing their hats in there. Here is the code.
PHP Code:
|
Quote:
PHP Code:
|
How would I detect is a player has that hat though?
|
Quote:
PHP Code:
|
PHP Code:
PHP Code:
|
I would suggest you start using ChatBar.onAction instead of onPlayerChats, preventing players from chatting commands looks better in the end.
That said, It would look something like this: PHP Code:
|
Why exactly using chatbar.onaction, it's much better to use onplayerchats.
For setting flags using non-scripted RC may we could add something to prevent cutting of the values if you don't touch it. Storing items is best done using clientr.*hatname or so and getstringkeys(). |
Quote:
|
guys, guys, guys.. hold up, why are you telling him to use a dot in the clientr flag?
don't use "clientr.hats.hatname", instead of the second dot, use a underscore! |
Quote:
|
Using a dot can be dangerous because certain item names can make problems, had a problem with RC login script once when "Trigger" tried to login (built-in variables and functions).
|
| All times are GMT +2. The time now is 03:14 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.