Wysłany: 2015-06-08, 19:13
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Witam napisa?em kodzik na logowanie si? do frakcji poprzez wej?cie w marker lecz skrypt nie dzia?a, po wej?ciu w marker nic si? nie dzieje. ?adnych b??d?w w DB 3. Jak bym m?g? naprawi? kod ?
m = createMarker ( 0 , 0 , 2 , "cylinder" , 2 , 255 , 0 , 0 , 255 )
team = createTeam ( "LSPD" , 255 , 0 , 0 )
addEventHandler ( "onMarkerHit" , thePlayer , function()
if isObjectInACLGroup ( "user." .. login , aclGetGroup ( "LSPD" ) ) then
local login = getAccountData ( getAccountName ( thePlayer ) )
setPlayerTeam ( thePlayer , team )
else
outputChatBox ( "Nie jeste? pracownikiem Policji" )
end
end )
Wysłany: 2015-06-08, 19:15
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
addEventHandler ( "onMarkerHit" , thePlayer , function()
Nie dziwi? si? jak ustalasz gracza jako marker
Wysłany: 2015-06-08, 19:23
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Dalej nie dzia?a
[ Dodano : 2015-06-08, 19:33 ]
Aha mam Debug Script 3:
ERROR: Frakcje/frakcje.lua:2: attempt to call global 'createTeam' (a nil value)
ERROR: [gameplay]/Frakcje/frakcje.lua:5: attempt to concatenate global 'login' (a nil value)
Wysłany: 2015-06-08, 19:34
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11 , bo on nie poprawi? tylko ci pokaza? b?ad zamie? z thePlayer na m
Wysłany: 2015-06-08, 19:40
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Zrobi?em tak
[ Dodano : 2015-06-08, 19:41 ]
I nic + edytowa?em kod i teraz pokazuje, ?e nie pracuje w policji a jestem w ACL.
m = createMarker ( 0 , 0 , 2 , "cylinder" , 2 , 255 , 0 , 0 , 255 )
team = createTeam ( "LSPD" , 255 , 0 , 0 )
addEventHandler ( "onMarkerHit" , m , function()
if isObjectInACLGroup ( "user. login.." , aclGetGroup ( "LSPD" ) ) then
local login = getAccountData ( getAccountName ( thePlayer ) )
setPlayerTeam ( thePlayer , team )
outputChatBox ( "Zalogowa?e? si? do Policji" )
else
outputChatBox ( "Nie jeste? pracownikiem Policji" )
end
end )
Wysłany: 2015-06-08, 19:45
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
m = createMarker ( 0 , 0 , 2 , "cylinder" , 2 , 255 , 0 , 0 , 255 )
team = createTeam ( "LSPD" , 255 , 0 , 0 )
addEventHandler ( "onMarkerHit" , m , function()
local login = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. login , aclGetGroup ( "LSPD" ) ) then
setPlayerTeam ( thePlayer , team )
outputChatBox ( "Zalogowa?e? si? do Policji" )
else
outputChatBox ( "Nie jeste? pracownikiem Policji" )
end
end )
Wysłany: 2015-06-08, 19:46
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
if isObjectInACLGroup ( "user. login.." , aclGetGroup ( "LSPD" ) ) then
Przygl?dnij si? poprawno?ci tej linijki
Wysłany: 2015-06-08, 19:48
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Z?e funkcje u?y?e? zamiast getAccountData to getAccountName a za getAccountName to getPlayerAccount
i ?le napisana
if isObjectInACLGroup ( "user. login.." , aclGetGroup ( "LSPD" ) ) then
if isObjectInACLGroup ("user."..login , aclGetGroup ( "LSPD" ) ) then
Wysłany: 2015-06-08, 19:51
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Gdy zrobi? tak if isObjectInACLGroup ( "user." .. login , aclGetGroup ( "LSPD" ) ) then to mi wywala b??d i nie pokazuje si? nawet wiadomo?? nie jeste? zalogowany.
DB3: [gameplay]/Frakcje/frakcje.lua:5: attempt to concatenate global 'login' (a nil value)
[ Dodano : 2015-06-08, 20:00 ]
m = createMarker ( 0 , 0 , 2 , "cylinder" , 2 , 255 , 0 , 0 , 255 )
team = createTeam ( "LSPD" , 255 , 0 , 0 )
addEventHandler ( "onMarkerHit" , m , function()
if isObjectInACLGroup ( "user." .. login , aclGetGroup ( "LSPD" ) ) then
login = getAccountName ( getPlayerAccount ( thePlayer ) )
setPlayerTeam ( thePlayer , team )
outputChatBox ( "Zalogowa?e? si? do Policji" )
else
outputChatBox ( "Nie jeste? pracownikiem Policji" )
end
end )
Kod wygl?da tak i wywala mi DB3:
ERROR: [gameplay]/Frakcje/frakcje.lua:5: attempt to concatenate global 'login' (a nil value)
Wysłany: 2015-06-08, 20:35
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
m = createMarker ( 0 , 0 , 2 , "cylinder" , 2 , 255 , 0 , 0 , 255 )
team = createTeam ( "LSPD" , 255 , 0 , 0 )
addEventHandler ( "onMarkerHit" , root , function( e )
if source ~= m then return end
login = getAccountName ( getPlayerAccount ( e ) )
if isObjectInACLGroup ( "user." .. login , aclGetGroup ( "LSPD" ) ) then
setPlayerTeam ( e , team )
outputChatBox ( "Zalogowa?e? si? do Policji" , e , 255 , 255 , 255 )
else
outputChatBox ( "Nie jeste? pracownikiem Policji" , e , 255 , 255 , 255 )
end
end )
Wysłany: 2015-06-08, 20:39
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Dobrze dzia?a ju?, dzi?kuje wszystkim za pomoc i postawi? zimne
Wysłany: 2015-06-08, 20:48
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Tagi: logowanie :: frakcji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: