Forum

> > CS2D > Scripts > what is wrong?
Forums overviewCS2D overview Scripts overviewLog in to reply

English what is wrong?

8 replies
To the start Previous 1 Next To the start

old what is wrong?

MethodMan
User Off Offline

Quote
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 '('
edited 1×, last 21.04.11 08:25:57 pm

old Re: what is wrong?

Yates
Reviewer Off Offline

Quote
You already made a thread!
What is the error in the console!?

old Re: what is wrong?

J4x
User Off Offline

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

old Re: what is wrong?

3RROR
User Off Offline

Quote
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

old Re: what is wrong?

Banaan
User Off Offline

Quote
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.

old Re: what is wrong?

Mechanolith
User Off Offline

Quote
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...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview