MIRIX
Wiek: 25 Na forum: 2382 dni Posty: 20
Nick w MP: MIRIX
witam, przychodze zn?w , dzis gdy przerabialem frakcje z pssm wyszedl jakis proble,m, w grze widoczny jest marker, pojazdy dzialaj? tylko gdy chce wejsc w marker nic sie nie dzieje, a powwino mnie logowac na sluzbe
ps. korzystam z bazy danych pys
local marker = createMarker (- 2120.02 , - 42.69 , 40.60 - 1 , 'cylinder' , 1.5 , 0 , 0 , 255 , 150 )
local marker2 = createMarker (- 2120.02 , - 42.68 , 40.60 - 1 , 'arrow' , 1.5 , 0 , 0 , 255 , 150 )
setElementData ( marker2 , "rpg_marker:job" , true )
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Rozpocz?cie pracy' )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
setElementPosition ( t ,- 2120.02 , - 42.68 , 40.60 )
function isPlayerInFaction ( plr )
local sid = getElementData ( plr , 'player:sid' )
if not sid then return end
local result = exports [ 'pystories-db' ]: dbGet ( 'SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;' , "PSP" , sid )
if result [ 1 ] then
return true
else
return false
end
end
local licz = {}
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInFaction ( el ) then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 239 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , 'PSP' )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'PSP' )
setElementData ( el , "player:rank" , rank )
giveWeapon ( el , 42 , 99999 )
exports [ "MIRIX-notyfikacje" ]: MIRIXnoti ( "#00ff00Rozpoczeto s?u?b?!" , el )
else
exports [ 'frakcja' ]: zatrzymajnaliczanie ( el )
takeAllWeapons ( el )
removeElementData ( el , 'player:duty' )
removeElementData ( el , "player:rank" )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
exports [ "MIRIX-notyfikacje" ]: MIRIXnoti ( "#ff0000Zako?czono s?u?b?!" , el )
end
else
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
Ostatnio zmieniony przez Wilq 2020-06-23, 19:35, w całości zmieniany 1 raz