English AUTO Add Table When Dropped and Remove Table when

10 replies
Goto Page
To the start Previous 1 Next To the start
Up
Unknown_Cheater
User
Offline Off
FULL TITLE: how to make AUTO Added Table when drop and remove when Collect weapon

so i want make table that can Backup all of this {weapon id, tile x, tile y, WEAPON[player id][weapon id][5]} for all dropped weapon

this example i make this only Backup {weapon id, tile x, tile y, WEAPON[player id][weapon id][5]} for 1 weapon
Spoiler >


and this full code
Spoiler >


sorry for my bad england
2084729947754920835
29.11.21 04:55:33 pm
Up
The Dark Shadow
User
Offline Off
I'm astonished by your great england! More tutorials please I love them
29.11.21 09:30:48 pm
Up
Unknown_Cheater
User
Offline Off
@user The Dark Shadow: sorry sir, but im asking not giving a tutorial
2084729947754920835
29.11.21 09:50:50 pm
Up
Mami Tomoe
User
Offline Off
I don't know what it is that you're making, or what it is that you wish for us to help you with.

But I do know that you're probably making this overly complicated, since the code has little to no documentation and seems to do a lot of redundant things.

Please don't use a translator, as it's quite obvious that you are, and it makes us unable to understand you, or what you need.
Look at me standing, here on my own again
30.11.21 12:51:56 am
Up
Unknown_Cheater
User
Offline Off
my script work fine sir, i only want to know how to add table when player drop and remove the table when player collect
example:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
BACKUP_DROP = {}
and player1 drop M4A1 then
BACKUP_DROP = {
     [1] = {32}
}
and then player2 drop USP then
BACKUP_DROP = {
     [1] = {32};
     [2] = {1}
}
and if player1 collect M4A1 that has dropped before then
BACKUP_DROP = {
     [2] = {1}
}
aaaaannnnndddd if player1 collect USP that has dropped by player2 before then
BACKUP_DROP = {}

understand? if still no
what can i do

edit:
Spoiler >
edited 1×, last 30.11.21 01:05:06 am
2084729947754920835
30.11.21 12:59:10 am
Up
Masea
Super User
Offline Off
So you want to have a table that simply contains the dropped items as their IDs. In fact, couldn't be easier! Your best friend for this is going to be cs2d lua hook drop where you get the ID of the dropped weapon and insert it to the aforementioned table, then cs2d lua hook collect comes into action! That's where you remove the particular item ID from the table by basically finding its table key.

Although this is how you would make it, make sure to tell us what you are planning to do with it.
Shit your pants: file cs2d Outlast II Mod (29) | Create your UI faster: CS2D UI Framework
30.11.21 07:59:55 pm
Up
Bowlinghead
User
Offline Off
More >

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- UNTESTED

addhook("drop","drop")
function (id,iid,type,ain, a, mode)

     local temp = {}
     temp.Id = id;
     temp.Iid = iid;
     temp.Type = type;
     temp.Ain = ain;
     temp.A = a;
     temp.Mode = mode;

     table.insert(BACKUP_DROP,temp)
end


https://www.lua.org/pil/19.2.html
Share time limited free games here
01.12.21 09:32:26 am
Up
Mora
User
Offline Off
If you having enough experience and patience to read my coffee, you may find in my file archive stalker mood, where I made such system. Free for use and edit everything what your need in there, you can cut and edit needed parts from it
01.12.21 11:39:51 am
Up
Unknown_Cheater
User
Offline Off
thanks for all who replies and super thanks to @user Bowlinghead and @user Mora and @user Masea it help me a lot
edited 2×, last 04.12.21 06:32:03 pm
2084729947754920835
01.12.21 02:10:32 pm
Up
Masea
Super User
Offline Off
user Unknown_Cheater has written:
thanks for all who replies and super thanks to @user Bowlinghead and @user Mora it help me a lot
Yeah don't mind me
Shit your pants: file cs2d Outlast II Mod (29) | Create your UI faster: CS2D UI Framework
04.12.21 06:43:12 pm
Up
Unknown_Cheater
User
Offline Off
@user Masea I have added your name sir sorry for my mistake.
2084729947754920835
To the start Previous 1 Next To the start