English Script Gut bomb

14 replies
Goto Page
To the start Previous 1 Next To the start
26.06.18 11:21:25 am
Up
NeptooN
User
Offline Off
Hello us
do you know how to make a scenario you drop a gut bomb and appear 2 things usp and awp? help me?
26.06.18 11:48:45 am
Up
Gaios
Security Supporter
Offline Off
Yes, I do.
26.06.18 12:17:31 pm
Up
danilqra
User
Offline Off
×
edited 1×, last 28.01.19 05:04:29 pm
Da Ny
26.06.18 12:32:07 pm
Up
NeptooN
User
Offline Off
@user danilqra: I tried, I couldn't.
26.06.18 12:47:25 pm
Up
Masea
Super User
Offline Off
Things need to be answered by you:
• Will gut bomb be removed when you drop it or will it stay?
• Will the items appear at the tile which we exactly are staying on at that moment, or will they be equipped to yourself?
• Let's say the code is not going to make us equipped these and instead they'll spawn somewhere, will they spawn as messy (randomly-like) or exactly under of us?

So after these questions are answered, the current code could be changed subsequently.

Code:
1
2
3
4
5
6
7
addhook("drop", "_drop")
function _drop(id, iid, type, ain, a, mode, x, y)
    if type == 86 then
        parse("spawnitem 1 "..x.." "..y)
        parse("spawnitem 35 "..x.." "..y)
    end
end
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (26)
26.06.18 01:46:55 pm
Up
NeptooN
User
Offline Off
@user Masea:
Look. The player throws a gut bomb and an awp and USP appears. Appear in the place where the player threw the gut bomb, can take these things, and they no longer appears if the player does not throw another gut bomb. and if the player threw a gut bomb it disappears.

sorry for my English
26.06.18 01:47:41 pm
Up
danilqra
User
Offline Off
×
edited 2×, last 28.01.19 05:04:21 pm
Da Ny
26.06.18 01:49:38 pm
Up
NeptooN
User
Offline Off
@user danilqra:
user NeptooN has written:
@user danilqra: I tried, I couldn't.
can you read?
26.06.18 01:50:47 pm
Up
danilqra
User
Offline Off
×
edited 1×, last 28.01.19 05:04:13 pm
Da Ny
26.06.18 01:52:28 pm
Up
Rainoth
Moderator
Offline Off
hook projectile
function projectile
spawnitem floor(position/32)
end

You'll need cs2d lua cmd addhook, cs2d lua cmd parse, cs2d cmd spawnitem and math.floor functions to accomplish what you want. Naturally, the code above is a pseudo code to point you towards the correct direction.

Good luck
26.06.18 02:09:30 pm
Up
NeptooN
User
Offline Off
@user Rainoth: Thank you, but I don't understand this.

@user danilqra: Yes, I'm very difficult I do not understand
26.06.18 02:20:39 pm
Up
Rainoth
Moderator
Offline Off
Try to locate where you installed CS2D then navigate to sys/lua/samples/ and look at the files there. They'll teach you a lot about how to make simple things in lua. It's a good place to start.
26.06.18 02:21:33 pm
Up
Masea
Super User
Offline Off
user NeptooN has written:
@user Rainoth: Thank you, but I don't understand this.
Sometimes it is hard hence you should try - to understand. And you should need to want to learn Lua first before you want to do something with Lua.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (26)
26.06.18 02:26:42 pm
Up
danilqra
User
Offline Off
×
edited 1×, last 28.01.19 05:04:50 pm
Da Ny
26.06.18 03:11:28 pm
Up
NeptooN
User
Offline Off
@user danilqra: Couldn't you have done that before?
Thank you
To the start Previous 1 Next To the start