English Trigger Use.

14 replies
Goto Page
To the start Previous 1 Next To the start
29.04.11 02:10:57 pm
Up
Egoist
User
Offline Off
I want to make a prison map and , cts will have weapons when
press "E" near trigger use I looked other comments but I didnt understand.

I want to make this:

example:

Press"e" then
equip id deagle(weapon id = 3)

Sorry for bad english

Thanks for helps.
29.04.11 02:57:53 pm
Up
Surplus
User
Offline Off
Can be made with map editor.
But not as effective as lua.
29.04.11 09:08:15 pm
Up
Egoist
User
Offline Off
how can you show me ?
29.04.11 09:24:47 pm
Up
Bowlinghead
User
Offline Off
trigger_use
Name:
Trigger: deagle

Env_item
Name: deagle
Trigger:
Share time limited free games here
30.04.11 03:43:59 pm
Up
Egoist
User
Offline Off
I dont mean this I know how to do it.
I wanna do this
I saw this at a server.
When you use the button
It gives direct weapon.
It gives to you not to floor.
I want it I know how to it with an entity.
30.04.11 05:37:13 pm
Up
Homam
User
Offline Off
Tell me the TileX and TileY and the weapon id, and i will try to make it.

Note: Give me the TileX, TileY on this pattern,

IMG:http://i54.tinypic.com/260wk07.jpg


Not Like This!

IMG:http://i56.tinypic.com/2ivz2vs.jpg
edited 1×, last 30.04.11 05:50:24 pm
30.04.11 07:41:28 pm
Up
Egoist
User
Offline Off
HoMaM gived me code but
when I press deagle's button
then usp's button
I have all 2 weapons usp and deagle
I want this:
example:I got deagle then I press usp's button
deagle will be dropped on the floor
usp will be equiped
who can do this ???



This is my code:

addhook("use","gunbuy2")
function gunbuy2(id,event,data,x,y)
if (x == 11 and y == 88) then
parse("equip "..id.." 3")
end
end
30.04.11 07:48:33 pm
Up
3RROR
User
Offline Off
user Egoist has written:
HoMaM gived me code but
when I press deagle's button
then usp's button
I have all 2 weapons usp and deagle
I want this:
example:I got deagle then I press usp's button
deagle will be dropped on the floor
usp will be equiped
who can do this ???



This is my code:

addhook("use","gunbuy2")
function gunbuy2(id,event,data,x,y)
if (x == 11 and y == 88) then
parse("equip "..id.." 3")
end
end


Didn't tested.
Code:
1
2
3
4
5
6
addhook("use","gunZ")
function gunZ()
if trigger == usetrigger1 then
    parse(spawnitem 1 11 88)
end
end
IMG:http://gamerswins.com/images/ins/logo.png
30.04.11 07:57:41 pm
Up
Homam
User
Offline Off
@RedFrix, Dude, the script works, read her/his comment again...

@TheFire1

TheFire1 has written:
This is my code:


Yours? I give it to you..
30.04.11 08:26:48 pm
Up
3RROR
User
Offline Off
user Homam has written:
@RedFrix, Dude, the script works, read her/his comment again...

@TheFire1

TheFire1 has written:
This is my code:


Yours? I give it to you..

user Egoist has written:
deagle will be dropped on the floor

Btw. The id1 is USP. Change it to Deagle.
IMG:http://gamerswins.com/images/ins/logo.png
01.05.11 03:16:30 am
Up
Dovahkin
User
Offline Off
What you mean event in that usebutton?

just try this!

Code:
1
2
3
4
5
6
7
addhook("say","lol")
function lol(id,txt)
     if(txt=="!equip") then
          parse("equip "..id.." 1")
          parse("spawnitem 1 11 88")
     end
end


i think it will work?
IMG:http://i561.photobucket.com/albums/ss59/killerboy_04/76561198036665859.png
01.05.11 02:08:00 pm
Up
EngiN33R
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function contains(table, element)
    for _, value in pairs(table) do
        if value == element then
            return true
        end
    end
    return false
end

addhook("usebutton","megabutton")
function megabutton(id,x,y)
     if (x==BUTTONTILEX and y==BUTTONTILEY) then
          for i=1,6 do
               if (contains(playerweapons(id),i)) then
                    parse("strip "..id.." "..i)
                    parse("spawnitem "..i.." "..player(id,"tilex").." "..player(id,"tiley"))
                    parse("equip "..id.." 4")
               end
          end
     end
end

I think this is what you meant.

no read, go post
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
02.05.11 01:25:54 pm
Up
Egoist
User
Offline Off
I must write HoMaM'S ??


HoMaM has written:
read his/her...

Quote:
wtf her x.x



Engineer has written:
function contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end

addhook("usebutton","megabutton")
function megabutton(id,x,y)
if (x==BUTTONTILEX and y==BUTTONTILEY) then
for i=1,6 do
if (contains(playerweapons(id),i)) then
parse("strip "..id.." "..i)
parse("spawnitem "..i.." "..player(id,"tilex").." "..player(id,"tiley"))
parse("equip "..id.." 4")
end
end
end
end


Quote:
Didnt work :(( You know my problem but I am pressing buttons but dont gives weps.
edited 1×, last 02.05.11 01:42:09 pm
02.05.11 06:04:37 pm
Up
Homam
User
Offline Off
TheFire1 has written:
Didnt work :(( You know my problem but I am pressing buttons but dont gives weps.


Did you even changed the "BUTTONX" and "BUTTONY" ?
If you did, then idk what to do.
02.05.11 06:09:50 pm
Up
Egoist
User
Offline Off
you mean this :"if (x==BUTTONTILEX and y==BUTTONTILEY) then" I changed it didnot work


-----------------


Hey guys I want to make this code like this:

A player got a M4A1 from the button,
then he press to aug's button then lua will not give him aug.
He must drop m4a1 for get aug.

I dont know I could explain my problem to you.

Sorry for bad english
I only learn it from school
And from films
edited 1×, last 07.05.11 04:43:21 pm
To the start Previous 1 Next To the start