Forum

> > CS2D > Scripts > Gun script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Gun script

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Gun script

Caelenn
User Off Offline

Zitieren
Hi
I need help with a (simple) script.
How to make that:
When i say "!mgun" i get m249, but i lost 5000$.
Pls help.
Spoiler >

alt Re: Gun script

RAVENOUS
BANNED Off Offline

Zitieren
1
2
3
4
5
6
7
8
addhook("say","items")
function items(p,txt)
	if (txt=="!lm") then
		if player(p,"money)>=5000 then
			parse("equip "..p.." 87")
		end
	end
end
1× editiert, zuletzt 29.01.11 17:55:15

alt Re: Gun script

Anders4000
User Off Offline

Zitieren
Zitat
1
2
3
if player(p,"money)=<5000 then
               parse("equip "..p.." 87")
end


It shall be "if player(p,"money)=>5000"
His has to have 5000 or more...

And you gotta take 5000 money from him, after the equip...

alt Re: Gun script

KimKat
GAME BANNED Off Offline

Zitieren
Then this would work I assume.
1
2
3
4
5
6
7
8
9
10
addhook("say","items")
function items(p,txt)
	if (txt=="!buy item 87") then
	if player(p,"money")>=5000 then
		player(p,"money")-5000
		parse("equip "..p.." 87")
	else
		msg2(p,[[©255075075You don't have enough money to purchase this item.@C]])
	end
end
To me it's logical, but if it doesn't work then it's my bad.
1× editiert, zuletzt 29.01.11 18:28:22

alt Re: Gun script

RAVENOUS
BANNED Off Offline

Zitieren
Anders4000 hat geschrieben
It shall be "if player(p,"money)=>5000"

in fact it should be
1
>=
I was in rush hour. Edited.

And you forgot a " in your scriptpart.

alt Re: Gun script

TimeQuesT
User Off Offline

Zitieren
1
2
3
4
5
6
if (txt=="aa") then
if(player(p,"money")>=5000) then
parse ("equip "..p.." idk weap id ;)")
parse ("setmoney "..p.." "..player(p,"money")-5000)
end
end
insert this --> into the "say" hook.

alt Re: Gun script

Homam
User Off Offline

Zitieren
@KimKat It works good.
but my question
can you make it only for some usgn's?
more than one
thx,

alt Re: Gun script

KimKat
GAME BANNED Off Offline

Zitieren
This Lua script might work then.
Spoiler >
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht