Forum

> > CS2D > Scripts > what is wrong?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch what is wrong?

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt what is wrong?

MethodMan
User Off Offline

Zitieren
WHAT IS WRONG?

adminlist = {21825}

addhook("buy")
function("buy,menu")

addhook("menu","playermenu")
function playermenu(id...,title,buton)
if title=="player...id... menu" then
if buton==1 then
menu(id,"buy times")
elseif buton=2 then
menu("id,spawn item,pistols,shotguns,rifles,laser,super armor,back")
setmoney ("player,id,-8000")
-------------------------------------------------------
This and the error
LUA ERROR: sys/lua/ads.lua:4: '<name>' expected near '('
1× editiert, zuletzt 21.04.11 20:25:57

alt Re: what is wrong?

J4x
User Off Offline

Zitieren
Almost everything is wrong, you should practice more before triying to script.

alt Re: what is wrong?

3RROR
User Off Offline

Zitieren
Here's the problems.
You can't add an addhook without a name:
1
2
3
addhook("buy") -- is nothing. Need a name.
-- The right one is
addhook("buy","buyexample")

And much more. Like
Where is the calling in adminlist?
The function is bad. should be function buyexample(id)
And much more.
Btw. Even TEXT is fail. buton?

More edits:
There's no end? Then it will show a nil

alt Re: what is wrong?

Banaan
User Off Offline

Zitieren
Do you have any idea what you are doing there?

I ask you to keep that in your personal archive, so when you grew up and learnt some decent Lua, you can laugh as hard as I just did about the mistakes you made when you were young.

Study the examples and other easy Lua scripts very carefully, and spot the differences between them and your snippet.

And use [ code ] tags and a bit of an intelligent title and description.

Learn the difference between = and ==, the difference between .. and ..., the meaning of quotes and commas, and read the info.txt in your lua folder.

alt Re: what is wrong?

Mechanolith
User Off Offline

Zitieren
Seriously, i started practicing lua a a week ago, or a little more. And i know that is a f**king great fail, there is nothing right there, but only addhook...
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht