Forum

> > CS2D > Scripts > Say-menu command
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Say-menu command

14 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Say-menu command

Homura Kami
User Off Offline

Zitieren
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

alt Re: Say-menu command

DC
Admin Off Offline

Zitieren
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()

alt Re: Say-menu command

Avo
User Off Offline

Zitieren
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)

alt Re: Say-menu command

Homura Kami
User Off Offline

Zitieren
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

alt Re: Say-menu command

Homura Kami
User Off Offline

Zitieren
The error occer @line 14 pls fix
Spoiler >

Error log(for log)
Spoiler >

These is what happen
Spoiler >

Pls help me!
1× editiert, zuletzt 03.07.13 15:57:12

alt Re: Say-menu command

Rainoth
Moderator Off Offline

Zitieren
you have declared

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

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

alt Re: Say-menu command

Homura Kami
User Off Offline

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

alt Re: Say-menu command

Rainoth
Moderator Off Offline

Zitieren
user Homura Kami hat geschrieben
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.

alt Re: Say-menu command

Homura Kami
User Off Offline

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

Console logs
Spoiler >


Pls help!

alt Re: Say-menu command

Avo
User Off Offline

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

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

alt Re: Say-menu command

Rainoth
Moderator Off Offline

Zitieren
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 ?

alt Re: Say-menu command

mr_s
User Off Offline

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

alt Re: Say-menu command

Homura Kami
User Off Offline

Zitieren
First post
Spoiler >


Next post:
@user mr_s:
Spoiler >

@user Rainoth:
Spoiler >

@everypost
Spoiler >

My new lua look like these(no bug now)
Spoiler >
3× editiert, zuletzt 07.07.13 02:43:55
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht