Forum

> > CS2D > Scripts > Hats for VIP and above.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hats for VIP and above.

8 replies
To the start Previous 1 Next To the start

old Hats for VIP and above.

Outcast
User Off Offline

Quote
Hello! I'm new to scripting and i would like to add hats for my script. But i want the hats to be only for VIP's and above. Can anyone post the code for me because I'm new to scripting. There are only three ranks: VIP,Moderator, and Admin.

old Re: Hats for VIP and above.

GeoB99
Moderator Off Offline

Quote
You could've just search for that either on File Archive or on the topics which talk about this.

Here is an example of a script (took me just few seconds to search):
file cs2d HC Admin Script 1.9.3
Beside from hats feature, the above ranks group such as Moderator or Admin have particular privileges or powers to punish the players who are violating the rules of a server. All of these groups have (include the V.I.P rank as well) already the privilege regard Hats.

old Re: Hats for VIP and above.

THEMUD
User Off Offline

Quote
If you mean putting the abilities to the VIP rank to use hats.
Then here it is.
Code >

Inform about any issues you find toward this script.

old Re: Hats for VIP and above.

Rainoth
Moderator Off Offline

Quote
Then find a simple hat script by using search (I hope u tried it) and add line
1
if variableForVIP[id] == true then -- or 1 instead of true
where 'variableForVIP' is the variable that determines whether the person is VIP or not. It's different in every script so you'll have to find it yourself. Place another 'end' near the rest. The line should be placed where player could start getting a hat.

Hope that helps

old Re: Hats for VIP and above.

Rainoth
Moderator Off Offline

Quote
use serveraction hook and check if first button (F2 in your case) was pressed, then open the menu the same way he did.

old Re: Hats for VIP and above.

THEMUD
User Off Offline

Quote
user Outcast has written
But how to make it in F2? @user THEMUD:

Well, I made it by saying "!hats".
Therefore, by just saying !hats, a menu will come out and then you will be able to use the hats.
You can change it though.

old Re: Hats for VIP and above.

GeoB99
Moderator Off Offline

Quote
In case if you don't get user Rainoth's point, here is a detailed description:

1
2
3
4
5
6
addhook ("serveraction","Hatsmenu")
function Hatsmenu(id, action)
	if action == 1 -- Which 1 refers to F2 button, you can change also to 2 or 3, your choice
		menu(id,"Hats menu, First hat, Second hat, Third hat, Remove the recent hat!") -- This is the menu list with hats in it, you can add more in your choice
	end
end
Where in the menu line, you can add more hats inside the () in your choice. Of course, this hook must accompanied with cs2d lua hook menu hook to specify the buttons' actions (it can be also done in other way, but this one is the basic). Like say...
More >

Which "First hat" is the first button and whenever you're clicking it, the specific hat appears. What I told here is only the basics, the rest you can find it yourself and it's your choice if you want to stay with user THEMUD which contains "!hats" command that opens the menu (NOTE: user THEMUD's method regard opening a menu with a command by saying it uses cs2d lua hook say hook) or using this method.

Edit1: And seeing as you are a newbie scripter, I'd recommend to everyone (even to you) to read first this CS2D scripting in Lua by user ohaz. This tutorial helped me quite a lot with the first basics and a good start to practise.
CS2D Scripting in Lua by Ohaz
Don't get so hype though because when you start practising, you'll have a long road to go but it's worth it. After that, I'd also recommend this Lua pil for beginners to fulfil further basics in Lua.
http://www.lua.org/pil/1.html
You can find also other useful tutorials out there in Unreal Software to cover your needs by searching.

Good luck and hope it was helpful somehow!
edited 2×, last 15.11.15 03:00:02 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview