Forum

> > CS2D > Scripts > Only hats for a menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Only hats for a menu

43 replies
Page
To the start Previous 1 2 3 Next To the start

old Re: Only hats for a menu

GeoB99
Moderator Off Offline

Quote
I don't have so much time currently so at the moment use this piece of code until user Rainoth comes and gives you a better way. Note that you must add
"say"
first in
hats.hooks
table and add this at the nearly end of your code.
1
2
3
4
5
6
7
8
9
10
11
12
function h_say(id, message)
   if string.sub(message, 1, 10) == "!removehat" then
      if hats.player[id] then
         freeimage(hats.player[id])
         hats.player[id] = nil
         msg2(id, "Your hat has been successfully removed!")
      else
         msg2(id, "You don't have any hat!")
      end
   return 1
   end
end

old Re: Only hats for a menu

Rainoth
Moderator Off Offline

Quote
You don't even need that. I already defined a separate function 'removeHat' if you want to remove a hat.
My code in user GeoB99's post contains what you wanted. Check line 67 and line 105. It will remove hat if the player is a terrorist. That's what you asked me for before.
To the start Previous 1 2 3 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview