Forum

> > CS2D > Scripts > I can't reach players name in menu in function
Forums overviewCS2D overview Scripts overviewLog in to reply

English I can't reach players name in menu in function

11 replies
To the start Previous 1 Next To the start

old I can't reach players name in menu in function

acm
User Off Offline

Quote
1
2
3
4
5
6
7
8
function votecpt()
	for id=1,32 do
		if player(id,"exists") then
			menu(id,"Vote Captain,"..player(1,"name")..",xx")
		end
	end
	timer(10000,"votcptends","",1)
end

I can't reach players name in menu in function, if i use a msg like msg(player(id,"name") i can reach but if i use it on menu i can't access player(id,"name") can u guys help. Thanks for read.

old Re: I can't reach players name in menu in function

TrialAndError
User Off Offline

Quote
If what @user Cure Pikachu: said is true then

1
2
3
4
5
6
7
8
9
10
function votecpt()
    local menuBuilder = {"Vote Captain"}
    for id = 1, 32 do
         if player(id,"exists") then
            menuBuilder[#menuBuilder+1] = player(id, 'name')
         end
    end
    menu(0, table.concat(menuBuilder, ','))
    timer(10000,"votcptends","",1)
end

And then add some logic for next page etc

old Re: I can't reach players name in menu in function

acm
User Off Offline

Quote
@user Cure Pikachu: Yes bro you are true.

@user Bowlinghead: Calm down Bowling Head you don't need this infos for giving true answer.

Guys i am sorry, I couldn't explain properly.

I mean i'cant reach the name of player id 1.

1
2
3
4
5
6
function votecpt()
	for id=1,32 do
			menu(id,"Vote Captain,"..player(1,"name")..","..player(2,"name")..","..player(3,"name")..","..player(4,"name")..","..player(5,"name")..","..player(6,"name")..","..player(7,"name"))
		end
	timer(10000,"votcptends","",1)
end

I can reach id 2 or 3,4,5...

I can't reach id 1 name thanks for read.

IMG:https://i.hizliresim.com/nxNcvG.jpg


I also can't reach player id 1 name in menu on F2 hotkey.

1
2
3
4
5
6
addhook("serveraction","serveraction_hook")
function serveraction_hook(id,action)
	if action == 1 then
		menu(id,"Normal,"..player(id,"name")..",Slot2")
	end
end

IMG:https://i.hizliresim.com/CULe9t.jpg


Actually, the problem is not id 1. I can't reach that id, what id i am.
edited 1×, last 03.06.20 06:06:31 am

old Re: I can't reach players name in menu in function

acm
User Off Offline

Quote
@user Cure Pikachu: I can't believe this. You are true bro. My nickname has "|" symbol. This problem due in my nickname. Really thanks bro.

@user Gaios: Dude i don't need them. I don't need any scripts. I just want to ask a question for using player(id,"name") code in menu.

@user The Dark Shadow: It isn't important to use someone else's script. We are developing ourselves here. I wanted to write this script with my own hands, that's all.

Thanks for your interest guys, problem solved.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview