Forum

> > CS2D > Scripts > How Apairs USGN
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How Apairs USGN

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How Apairs USGN

Ashley
BANNED Off Offline

Zitieren
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

alt Re: How Apairs USGN

Marcell
Super User Off Offline

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

alt if

Ashley
BANNED Off Offline

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

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

alt Re: How Apairs USGN

Marcell
Super User Off Offline

Zitieren
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

alt Thx

Ashley
BANNED Off Offline

Zitieren
@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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht