Forum

> > CS2D > Scripts > How Apairs USGN
Forums overviewCS2D overview Scripts overviewLog in to reply

English How Apairs USGN

4 replies
To the start Previous 1 Next To the start

old How Apairs USGN

Ashley
BANNED Off Offline

Quote
Hi all , i made a new script name (Megarama Fun) And i wanna Know How apairs usgn , i know just these

1
2
local Acess=player(0,'table')
		for _,id in pairs(Acess) do

I wanna know what is apairs USGN and what i need to do
here the fully Hook and function...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Acess = {127798}

addhook('serveraction','serveraction_hook')
	function serveraction_hook(id,action)
	local Acess=player(0,'table')
		for _,id in pairs(Acess) do
			if action==1 then
			menu(id,'Menu A,RateMap,Help Commands')
			elseif action==2 then
			
			elseif action==3 then
			
			end
		end
	end

i wanna transfer apairs id to USGN how ?
but when i use simple (ID) and type my usgn , and start a new server that when i press console to see if works its says : Attempt to call a nil value

old Re: How Apairs USGN

Marcell
Super User Off Offline

Quote
1
2
3
for _, usgn in pairs(Acess)
if player(id,'usgn') == usgn then
...

old if

Ashley
BANNED Off Offline

Quote
You Should do an error : if player(id,'usgn') == usgn then

LUA ERROR: sys/lua/autorun/test.lua:10: 'do' expected near 'if'

old Re: How Apairs USGN

Marcell
Super User Off Offline

Quote
sorry... tested works fine


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Acess = {127798}

addhook('serveraction','serveraction_hook')
     function serveraction_hook(id,action)
	for _, usgn in pairs(Acess) do
	if player(id,'usgn') == usgn then
               if action==1 then
               menu(id,'Menu A, Rate Map, Help Commands')
               elseif action==2 then

               elseif action==3 then

               end
          end
     end
end

old Thx

Ashley
BANNED Off Offline

Quote
@user Marcell: I Will try again i , think the attemp call nil value is from another file and i will try to check all Thanks Man

Check Up with joining this server if u have time ... MP//Fun[Working]
Password : 123
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview