Wysłany: 2018-03-29, 21:12
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
Witam po raz pierwszy dosta?em taki b??d. Po wyj?ciu z frakcji skin mi si? nie zmienia b??d
Bad argument @ 'setElementModel' [ Expected number at argument 2 , got boolean ]
kod
local marker = createMarker (- 2442.32 , 3786.94 , 300.57 - 0.9 , 'cylinder' , 1 , 0 , 102 , 204 , 255 )
setElementDimension ( marker , 0 )
setElementInterior ( marker , 0 )
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Rozpocz?cie s?u?by\nLVPD' )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
setElementPosition ( t ,- 2442.32 , 3786.94 , 300.57 )
function isPlayerInPoliceFaction ( plr )
local uid = getElementData ( plr , 'player:uid' )
if not uid then return end
local result = exports [ 'ogrpg-db' ]: dbGet ( 'SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;' , "LVPD" , uid )
if result [ 1 ] then
return true
else
return false
end
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInPoliceFaction ( el ) then
--if getPlayerSerial ( el ) == "8FE50105E2AB81DFA78E08780A079292" then
if not getElementData ( el , 'player:duty' ) then
-- setPlayerNametagColor ( el , 0 , 0 , 255 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , 'LVPD' )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'LVPD' )
setElementData ( el , "player:rank" , rank )
giveWeapon ( el , 23 , 9999 )
giveWeapon ( el , 3 , 9999 )
setElementData ( el , "last:nick" , getPlayerName ( el ))
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#0000CD" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
-- setPlayerNametagColor ( el , 0 , 191 , 255 )
executeCommandHandler ( "setblipcolor" , el , 0 , 0 , 205 )
outputChatBox ( "Rozpocz??e? s?u?b? we frakcji LVPD!" , el )
else
takeWeapon ( el , 23 )
takeWeapon ( el , 3 )
takeWeapon ( el , 31 )
takeWeapon ( el , 32 )
exports [ 'frakcja' ]: zatrzymajnaliczanie ( el )
setElementData ( el , 'player:duty' , false )
setElementData ( el , "player:rank" , false )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
setPlayerName ( el , getElementData ( el , "last:nick" ))
executeCommandHandler ( "setblipcolor" , el , 255 , 255 , 255 )
outputChatBox ( "Zako?czy?e? s?u?b? we frakcji LVPD!" , el )
end
-- else outputChatBox ( "Frakcja LVPD zosta?a zawieszona!" , el ) end
else outputChatBox ( 'Nie jeste? zatrudniony we frakcji LVPD.' , el , 255 , 0 , 0 ) end
end )
function naliczanie ( el )
if isElement ( el ) then
local x = getElementData ( el , "player:workinjob" ) or 0
setElementData ( el , "player:workinjob" , x + 1 )
else
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
end
local bronie2 = createMarker (- 2444.89 , 3795.67 , 300.57 - 0.90 , "cylinder" , 1.0 , 0 , 255 , 0 , 30 )
setElementDimension ( bronie2 , 0 )
setElementInterior ( bronie2 , 0 )
local t = createElement ( "text" )
setElementData ( t , "name" , "Wyposa?enie LVPD" )
setElementPosition ( t ,- 2444.89 , 3795.67 , 300.57 )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
function bronie11 ( hitElement , matchingDimension )
if source == bronie2 then
if getElementData ( hitElement , "player:duty" ) == "LVPD" then
if getElementData ( hitElement , 'player:rank' ) <= 3 then outputChat ( "Jeste? aktualnie podczas akademii, nie przys?uguje Ci wyposa?enie!" ) return end
outputChatBox ( "Wzi??e? swoje wyposa?enie!" , hitElement )
giveWeapon ( hitElement , 32 , 90 )
else
outputChatBox ( "Nie jestes zatrudniony jako LVPD!" , hitElement )
end
end
end
addEventHandler ( "onMarkerHit" , bronie2 , bronie11 )
local bronie2222 = createMarker (- 2451.73 , 3795.27 , 300.57 - 0.90 , "cylinder" , 1.0 , 255 , 255 , 0 , 155 )
setElementDimension ( bronie2222 , 0 )
setElementInterior ( bronie2222 , 0 )
local t = createElement ( "text" )
setElementData ( t , "name" , "Wyposa?enie s?u?b specjalnych" )
setElementPosition ( t ,- 2451.73 , 3795.27 , 300.57 )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
function bronie11111 ( hitElement , matchingDimension )
if source == bronie2222 then
if getElementData ( hitElement , "player:duty" ) == "LVPD" then
if getElementData ( hitElement , 'player:rank' ) <= 49 then outputChat ( "Posiadasz ni?sz? rang?, nie przys?uguje Ci owe wyposa?enie!" ) return end
outputChatBox ( "Wzi??e? swoje wyposa?enie!" , hitElement )
giveWeapon ( hitElement , 31 , 9999 )
else
outputChatBox ( "Nie jestes zatrudniony jako LVPD!" , hitElement )
end
end
end
addEventHandler ( "onMarkerHit" , bronie2222 , bronie11111 )
Wysłany: 2018-03-29, 21:17
jagoreq
Wiek: 24 Na forum: 3221 dni Posty: 221
Nick w MP: dwd
Piwa : 18
Chodzi o to?:
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
Wysłany: 2018-03-29, 21:20
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
"jagoreq" napisał/a :Chodzi o to?:
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
tak
Wysłany: 2018-03-29, 21:23
jagoreq
Wiek: 24 Na forum: 3221 dni Posty: 221
Nick w MP: dwd
Piwa : 18
spr?buj:
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , tonumber ( skin ))
Wysłany: 2018-03-29, 21:25
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
"jagoreq" napisał/a :spr?buj:
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , tonumber ( skin ))
Nic nie pomog?o dalej ten sam b??d
Wysłany: 2018-03-29, 22:00
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Czy w bazie danych znajduje si? skin, kt?ry aktualnie masz na Sobie? Pami?taj, ?e skin nie mo?e by? zmieniony poprzez panel admina, a kupiony w sklepie z ubraniami kt?ry znajduje si? w plikach gamemode
Wysłany: 2018-03-29, 22:24
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
"Ciastuu?" napisał/a :Czy w bazie danych znajduje si? skin, kt?ry aktualnie masz na Sobie? Pami?taj, ?e skin nie mo?e by? zmieniony poprzez panel admina, a kupiony w sklepie z ubraniami kt?ry znajduje si? w plikach gamemode
owszem ma skin w bazie danych zapisany
Wysłany: 2018-03-29, 22:47
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Nie powinien wynika? z tego ?aden b??d bo kod jest dobry.
Wysłany: 2018-03-29, 23:01
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
"Ciastuu?" napisał/a :Nie powinien wynika? z tego ?aden b??d bo kod jest dobry.
a jako? b??d jest b??dy zwi?zane z baz? danych nie ma tylko to co poda?em jest bo to jest frakcja. W ka?dej frakcji takie co? wyst?puje
Wysłany: 2018-03-29, 23:16
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Co? pewnie nie tak z elementData "player:skin"
Wysłany: 2018-03-30, 12:56
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
"Ciastuu?" napisał/a :Co? pewnie nie tak z elementData "player:skin"
to co mog? zrobi? by to dzia?a?o
Wysłany: 2018-03-30, 14:06
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
"cyc11" napisał/a : "Ciastuu?" napisał/a :Co? pewnie nie tak z elementData "player:skin"
to co mog? zrobi? by to dzia?a?o
Sprawdzi?, czy taka elementData istnieje podczas zakupu skina, oraz w zapisie danych po wyj?ciu / wej?ciu na serwer.
Tagi: nie :: zmienia :: skina
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: