I was trying to make a script that allows admin to strip specific weapon from a specific player, however, It worked, but I had a problem with how to find out if that player had that weapon in the first place.
Like... I can force strip him, but i want a script that checks if the player had that weapon first or not.
And yes, i tried "playerweapons(id)" thing but it didn't work with my idk why, i don't even get error message in the console, it just doesn't work!
If someone can write that simple script for me i would be thankful, Im not lazy, I tried my best but i just didn't succeed for some reason...
I want something like !strip <id>, if that player didn't had the weapon, the sender of the stripping message will get something like: " The player you wanted to strip doesn't have "..weaponname.." ".
Just that.
Some of stupid attempts if you wanna laugh at me:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
if playerweapons(id,51) then parse("strip "..id.." 51") if playerweapons(id,HE) then parse("strip "..id.." 51") if playerweapons(id,"HE") then parse("strip "..id.." 51") if playerweapons(id) == 51 then parse("strip "..id.." 51") if playerweapons(id) == "HE" then parse("strip "..id.." 51")
Also, here is another attempt where i downloaded online script and tried to modifiy it... I was trying to make player receive message with "YES" if he had one of those 5 weapons you can see in the script...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
hasWeapon=function(id,weapon) for _,wpn in pairs(playerweapons(id)) do if weapon==wpn then return true end end end 	 weapons={ {"AK",30}, {"M4",32}, {"HE",51} } 		 addhook("say","anything") function anything(id,txt) for _,weapon in pairs(weapons) do if txt == "y" then if hasWeapon(id,weapon[2]) then msg2(id,"YES2") return 1 end end end end
edited 3×, last 03.08.22 12:44:29 am