Forum

> > CS2D > Scripts > Gas Granade Comand
Forums overviewCS2D overview Scripts overviewLog in to reply

English Gas Granade Comand

8 replies
To the start Previous 1 Next To the start

old Gas Granade Comand

jerumdiokkk
User Off Offline

Quote
Well I'm trying to make a script and i need your help

with the command !gas,the player buys a gas grenade
but he spends his money (if the player will keep buying your money runs out)
but even without money he can buy a grenade

as I do not buy it for the grenade without the money needed?

and when he did not have enough money, the message:
You Do not Have Enough Money

and the player can buy one for round, like a HE

until now I have it:
1
2
3
4
5
6
addhook("say","player_say")
function player_say(id,txt)
     if(txt=="!gas") then
          parse("setmoney "..id.." "..(player(id,"money")-1500))
          parse("equip "..id.." 72")
     end

old Re: Gas Granade Comand

J4x
User Off Offline

Quote
U can buy a grenade without money because u forgot to put whats the amount of money that u need to buy the grenade, I will try to fix your code
1
2
3
4
5
6
7
8
9
10
addhook("say","player_say")
function player_say(id,txt)
if(txt=="!gas") then
if player(id,"money") >= 1499 
parse("setmoney "..id.." "..(player(id,"money")-1500))
parse("equip "..id.." 72")
end
end
end
end

I haven´t tested yet but im 90% sure that it will work.

old Re: Gas Granade Comand

jerumdiokkk
User Off Offline

Quote
srry,dont work.it was a way of separating the f2 of f3,i will make another menu, because I already have a script that uses the f2.this script if you press f2 you can buy or drop a gas mask,in which case it used to take no damage from the gas grenade

old Re: Gas Granade Comand

Homam
User Off Offline

Quote
I will get glad to help you, What do you need? if you Press F3 you buy an gas grenade and money decrese ??

By the way, this lua for say:
1
2
3
4
5
6
7
8
9
10
11
addhook("say","gas")
	function gas(id,txt)
		if txt=="!gas" then
			if player(id,"money")>=1500 then
			parse("equip "..id.." 72")
			parse("setmoney "..id.." "..player(id,"money")-1500)
		else
			msg2(id,"©255000000You dont have money to buy gas grenade!@C")
		end
	end
end

and this lua for F3 buy gas..:

1
2
3
4
5
6
7
8
9
10
11
addhook("serveraction","gas")
	function gas(id,a)
		if a==2 then -- if you put a==1 it's F2 if you put a==2 then it will be F3 if you put a==3 then it will be F4 (the max is a==3)
			if player(id,"money")>=1500 then
			parse("equip "..id.." 72")
			parse("setmoney "..id.." "..player(id,"money")-1500)
		else
			msg2(id,"©255000000You dont have money to buy gas grenade!@C")
		end
	end
end

am sure this will work ^_^.
          
Thanks,
HoMaM .
edited 3×, last 12.02.11 07:42:25 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview