Forum

> > CS2D > Scripts > Say-menu command
Forums overviewCS2D overview Scripts overviewLog in to reply

English Say-menu command

14 replies
To the start Previous 1 Next To the start

old Say-menu command

Homura Kami
User Off Offline

Quote
Hey guys,I am making my lua but error stop I trying to make a say command with a menu command but these part doesn't work property
Spoiler >

I must work like these
Spoiler >

Thanky uo for every reply

old Re: Say-menu command

DC
Admin Off Offline

Quote
1. Always use code tags please!

2. I assume that humman.classes.words is a table which contains at leat "!humman class". Otherwise your code won't work. Make sure that you initialize that table correctly before using it.

3. See cs2d lua cmd parse
Parse is for CS2D commands, not for Lua functions. "humman.classes.classmenu" is NOT a CS2D function but probably a Lua function that you wrote yourself in Lua
Replace
1
parse("humman.classes.classmenu")
with just
1
humman.classes.classmenu()

old Re: Say-menu command

Avo
User Off Offline

Quote
1
humman.classes.classmenu()

I think he wants to open a menu for a player, so he needs to give ID parameter of certain player.

How about:
1
humman.classes.classmenu(p)

old Re: Say-menu command

Homura Kami
User Off Offline

Quote
okey my lua(full) was here
Spoiler >

But the error was in line 14 so i show only that part
I hope i can fix it soon

old Re: Say-menu command

Homura Kami
User Off Offline

Quote
The error occer @line 14 pls fix
Spoiler >

Error log(for log)
Spoiler >

These is what happen
Spoiler >

Pls help me!
edited 1×, last 03.07.13 03:57:12 pm

old Re: Say-menu command

Rainoth
Moderator Off Offline

Quote
you have declared

1
human.classes.word
but not
1
human.classes.words

You're trying to get length of a non-existing table.

old Re: Say-menu command

Homura Kami
User Off Offline

Quote
Thx you everyone to give me hand.Now all error is gone but when i say !humman class it is idle help!

old Re: Say-menu command

Rainoth
Moderator Off Offline

Quote
user Homura Kami has written
Thx you everyone to give me hand.Now all error is gone but when i say !humman class it is idle help!


You make it too complicated.
Just change hook to sth like.
1
2
3
4
5
6
addhook("say","yes")
function yes(id,t)
	if t=="!humman" then
		menu(id,"Humman class,Thief|Super Speed,Engineer|Buildings,Spy|Invisibility,Police|Shield&Machete,Soldier|FN2000,Heavy unit|RPG,Doctor|Medic armor,Terrorist|Grenade(s),SWAT|XM1014")   
	end
end
Also. You made a menu "Humman class" while the menu hook is expecting "Humman classes"
so you'll have to change either one of these so they both match.

old Re: Say-menu command

Homura Kami
User Off Offline

Quote
Error line 11
Now my lua look like these
Spoiler >

Console logs
Spoiler >


Pls help!

old Re: Say-menu command

Avo
User Off Offline

Quote
You ate part of the spawn hooh, dude. By the way:

Line 11 - add "then" at the end of the line.

old Re: Say-menu command

Rainoth
Moderator Off Offline

Quote
Dude seriously ?
Did you even read what I wrote ?
Read it again.
And I provided a more simple way for say hook which has no grammatical errors.

In case you're absent-minded, I'll repeat myself.
You make a player get one menu but in menu hook check if there's another menu.

Say you say "Give me menu 1" and then check "if player has menu 2"

Now you get it ?

old Re: Say-menu command

mr_s
User Off Offline

Quote
worapat,
your script have 9999999 problems
when i fix a problem another problem will appear

old Re: Say-menu command

Homura Kami
User Off Offline

Quote
First post
Spoiler >


Next post:
@user mr_s:
Spoiler >

@user Rainoth:
Spoiler >

@everypost
Spoiler >

My new lua look like these(no bug now)
Spoiler >
edited 3×, last 07.07.13 02:43:55 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview