Forum

> > CS2D > Scripts > Flashplayer and admin weapon
Forums overviewCS2D overview Scripts overviewLog in to reply

English Flashplayer and admin weapon

23 replies
Page
To the start Previous 1 2 Next To the start

old Flashplayer and admin weapon

Mora
User Off Offline

Quote
Hi guys!
I need a little script with Flashplayer
1
2
3
4
5
addhook("attack","_Fire")
function _Fire(id,wpn)
if wpn==30 then
("parse flashplayer ..id.. 15")
end end
is not work...but i want Work.
And one...
1
2
3
4
if weapon == 30 and player(id,"usgn") == 114940 then
can take weapon 30
for i 1,32 do
cant take weapon 30
and massage :you can`t take Admin weapon!
Please help with this.
And please sorry for my bad English
Thanks you
edited 1×, last 22.07.13 10:22:00 pm

old Re: Flashplayer and admin weapon

Mora
User Off Offline

Quote
• I need to when shot from AK-47 then the player flashed.
• I need to only I could take the Ak-47 and if someone will try to take another AK-47 he will not be able to take him instead climbs message : you can't take the admin weapons.
Please help me

old Re: Flashplayer and admin weapon

Bowlinghead
User Off Offline

Quote
Oh my fucking god...

Just learn how to use LUA in CS2d then your question is gonna be unnecessary.

At first:
Write line 4 like this:
1
parse("spawnplayer "..id.." 15")
I don´t really know. Is there a command called "spawnplayer"?

If you want to flash him like a flashbang then you should make his screen white with fade out...


At your second problem:
1
2
3
4
5
6
7
8
9
addhook("collect","Deutscher_Hook_Name")
function Deutscher_Hook_Name(id,iid)
	if iid==30 and player(id,"usgn")~=114940 then
		return 1;
		msg2(id,"You are not allowed to pick up the CHEATER ADMIN GUN!!! D:")
	elseif iid==30 and player(id,"usgn")==114940 then
		return 0;
	end
end

old Re: Flashplayer and admin weapon

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
addhook("hit","Ivebeenpotato")
function Ivebeenpotato(yd,sours,wep)
	if player(sours,"usgn")==99999 and wep == 30 then
		parse("flashplayer "..yd.." 50")
	end
end

Less code and more logical. You're aiming that only admin could flash via hit. You should allow others to carry ak-47. Don't worry, it won't work with others

If you still insist on a worse solution :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("hit","hit_hook")
function hit_hook(i,s,w)
	if w==30 then
		parse("flashplayer "..i.." 50")
	end
end

addhook("walkover","collect_hook")
function collect_hook(id,iid)
	if iid==30 then
		if player(id,"usgn")==114940 then
			return 0
		else
			msg2(id,"You can't pick up this weapon.")
			return 1
    	end
	end
end

EDIT : @user Avo: ok then ~~
edited 1×, last 22.07.13 10:42:36 pm

old Re: Flashplayer and admin weapon

Avo
User Off Offline

Quote
I don't have time atm to do it for user Mora, but guys, you have to use "walkover" hook instead of "collect".

Edit: and hook functions return 0 by default as far as I know, you don't have to use if-else blocks to return 0.
edited 1×, last 22.07.13 10:46:54 pm

old Re: Flashplayer and admin weapon

Bowlinghead
User Off Offline

Quote
Yes, you are right...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("hit","hit_hook")
function hit_hook(i,s,w)
     if w==30 then
          parse("flashplayer "..i.." 50")
     end
end

addhook("walkover","collect_hook")
function collect_hook(id,iid)
     if iid==30 then
          if player(id,"usgn")~=114940 then
               msg2(id,"You can't pick up this weapon.")
               return 1;
         end
     end
end

The final script.

old Re: Flashplayer and admin weapon

useigor
User Off Offline

Quote
Well, i'm not lua scripter but tried to help and spent +1 hour on searching needful code.
BTW, both codes of user Rainoth and user Bowlinghead for AK47 doesn't works for me.

1
2
3
4
5
6
7
8
9
addhook("walkover","no30")
function no30(id,iid,t)
	if (player(id,"usgn") == 114940) and t==30 then
		return 0
	elseif (player(id,"usgn") ~= 114940) and t==30 then
		msg2(id,"Сгинь смерд от божественного оружия! СГИНЬ!!!")
		return 1
	end
end

Fuck! I lost my 6 month of no playing...
edited 1×, last 22.07.13 11:25:33 pm

old Re: Flashplayer and admin weapon

Bowlinghead
User Off Offline

Quote
@user useigor: Of course, you have to change your USGN-ID and have to be logged in...

1
if (player(id,"usgn") == 114940) and t==30 then

The line says:
"If the USGN-ID is 114940 and the player walks over an AK47 then..."

But your USGN-ID is 13296 so the code should be:
1
2
3
4
5
6
7
8
9
addhook("walkover","no30")
function no30(id,iid,t)
     if (player(id,"usgn") == 13296) and t==30 then
          return 0
     elseif (player(id,"usgn") ~= 114940) and t==30 then
          msg2(id,"Сгинь смерд от божественного оружия! СГИНЬ!!!")
          return 1
     end
end

old Re: Flashplayer and admin weapon

useigor
User Off Offline

Quote
user Bowlinghead, man, don't think that i so stupid and can't change USGN. With my USGN it's doesn't work. If i test as not admin (without USGN) then USGN doesn't matter but i still can take ID30 (AK) with yout script.
BTW, did you tested your own script before posting?

+ I wanted to write in my first message "i tested with my USGN" but i thought that no one will think i tested without USGN.
edited 1×, last 22.07.13 11:55:42 pm

old Re: Flashplayer and admin weapon

Avo
User Off Offline

Quote
I don't know what gamemode you want to use, but if standard, I locked buying admin weapons also:
Code >

Flashing player on single hit with strength 50 is pretty unfair, but from 5 to 10 is good.

old Re: Flashplayer and admin weapon

Mora
User Off Offline

Quote
Avobolt you God! thank you thank you tons a hundred times thank you!
How can I thank you?
√ you cool
√ you can do it all!
√ you are the best

old Re: Flashplayer and admin weapon

Mora
User Off Offline

Quote
Yes, even 1000 times!
Only it doesn't work.
When I get AK-47 then I can pick it up(but the message is still displayed) flashplayer does not work
And without USNG, I can also take the AK-47(get the message that I can't pick it)
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview