Forum

> > CS2D > Scripts > I do not find a hook for this.
Forums overviewCS2D overview Scripts overviewLog in to reply

English I do not find a hook for this.

6 replies
To the start Previous 1 Next To the start

old I do not find a hook for this.

cs2d_is_a_Gem
User Off Offline

Quote
Hi Guys, I have a question.
Is there any way to use the vip skin on users selected by usgn?
I need this to complete one of my servers.
Beforehand thank you very much. √

old Re: I do not find a hook for this.

cs2d_is_a_Gem
User Off Offline

Quote
There is no point in answering a question if you do not intend to help.
It's too bad our moderators are trolls.
You carese of the culture and the wisdom To answer my question.

old Re: I do not find a hook for this.

Rainoth
Moderator Off Offline

Quote
Oooh, tough luck. Looks like you have some problems with interpretation.
Fine, I'm a good guy so I'll have to write very simple and emphasize everything if I want you to understand. Here's the essence of your post:
user cs2d_is_a_Gem has written
Is there any way to use the vip skin on users selected by usgn?

to which I replied:
user Rainoth has written
Get the vip image and then place it as an image using lua scripts.


I did intend to help and I gave you all information needed to make what you want to have. I did not bother to write the actual code because I saw that you wrote a script before so I assumed that you knew where to find functions provided by CS2D for lua scripting.
If you don't know them, I can spare some more of my time and link them to you.

Here's how you do it:
1. use any hook you want for WHEN you want to place your images
2. create a table for images
3. store the vip images in the table if the player has certain usgn

old Re: I do not find a hook for this.

cs2d_is_a_Gem
User Off Offline

Quote
My knowledge in lua scrip are basic.
And I need help with this.
If you can help me do not hesitate to do it.

1
2
3
4
5
6
7
8
9
10
Admins = {admin usgn}
addhook("join","checkplayer")
function checkplayer(id)
     for _, usgn in ipairs(Admins) do
          if player(id,"usgn")==usgn then
               skin=image("gfx/admin.png",1,0,200+id)
          admin.png
          end
     end
end

old Re: I do not find a hook for this.

Rainoth
Moderator Off Offline

Quote
The script you posted ticks off #1 and #3.
Now you just have to do it
so basically
1
2
3
4
5
6
7
8
9
10
yourImageTable = {}
Admins = {admin usgn}
addhook("join","checkplayer")
function checkplayer(id)
     for _, usgn in ipairs(Admins) do
          if player(id,"usgn")==usgn then
               yourImageTable[id]=image("gfx/admin.png",1,0,200+id)
          end
     end
end

Note that this will NOT handle re-setting images or deleting them.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview