Forum

> > CS2D > Scripts > M4A1 Only for CT?
Forums overviewCS2D overview Scripts overviewLog in to reply

English M4A1 Only for CT?

4 replies
To the start Previous 1 Next To the start

old M4A1 Only for CT?

Mami Tomoe
User Off Offline

Quote
First thing, don't say I didn't try;
More >


I need a script that will only let Counter-Terrorist to pickup the M4A1.

Thanks in advance.

old Re: M4A1 Only for CT?

Rainoth
Moderator Off Offline

Quote
Do you even bother to look at scripts?
If you did, you'd know that most functions have arguments and player table needs an ID to get information from a certain player.

old Solution

Ace Howl
User Off Offline

Quote
@user Mami Tomoe has written
1
2
3
4
5
6
7
8
9
10
addhook ("walkover","m4a1")

function walkover
if ("player","walkover") == m4a1
then
if ("player","team") == 1
then return 0
else
return 1
end
Thanks in advance.


I can see that you are trying to make a code.

1
2
3
4
5
6
7
8
9
addhook("walkover","wo")

function wo(id,iid,type)
	if type==32 and player(id,"team")==1 then
		return 1
	else
		return 0
	end
end

old Re: M4A1 Only for CT?

Mami Tomoe
User Off Offline

Quote
@user Ace Howl: Thanks it worked!
I needed to remove the "addhook" and replace the "wo" with "rp_walkover" because I already have a script that uses this function.

@user Rainoth: I did and that what I came up with, like I said a lot I'm new to lua (not THAT new) so I edit scripts to learn how they work and if you take a look at @user Ace Howl: script you can notice I only had few mistakes...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview