Wysłany: 2016-04-25, 16:38
Xaar
Wiek: 25 Na forum: 5450 dni Posty: 47
Nick w MP: PLWESOLYKOSTEK
Piwa : 82
Witajcie, mam problem z funkcj? getmapname.
local screenW , screenH = guiGetScreenSize ()
local resW , resH = 1366 , 768
local sW , sH = ( screenW / resW ), ( screenH / resH )
function checkMap ( thePlayer )
local mapName = getMapName ()
dxDrawText ( "Map: \"" .. mapName .. "\"" , 15 * sW , 2 * sH , 20 * sW , 5 * sH , tocolor ( 0 , 0 , 0 , 255 ), 1.0 , "default-bold" )
end
function HandleTheRendering ( )
addEventHandler ( "onClientRender" , root , checkMap )
end
addEventHandler ( "onClientResourceStart" , resourceRoot , HandleTheRendering )
W debugscript wyskakuje komunikat "attempt to call global 'getMapName' (a nil value) b??d pewnie wyskakuje przez to, ?e funkcja getMapName jest server-side, tylko nie wiem jak to zrobi?, ?eby dzia?a?o. TriggerServerEvent? Je?eli tak to jak tego u?y?? Prosz? o pomoc.
Wysłany: 2016-04-25, 16:43
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
local screenW , screenH = guiGetScreenSize ()
local resW , resH = 1366 , 768
local sW , sH = ( screenW / resW ), ( screenH / resH )
local nazwa = false
function checkMap ( )
if nazwa then
dxDrawText ( "Map: \"" .. nazwa .. "\"" , 15 * sW , 2 * sH , 20 * sW , 5 * sH , tocolor ( 0 , 0 , 0 , 255 ), 1.0 , "default-bold" )
end
end
addEventHandler ( "onClientRender" , root , checkMap )
function PobierzNazwe ( )
triggerServerEvent ( "PotrzebujeNazwy" , localPlayer )
end
PobierzNazwe ()
setTimer ( PobierzNazwe , 5000 , 0 )
addEvent ( "OtrzymujeszNazwe" , true )
addEventHandler ( "OtrzymujeszNazwe" , root , function( mapa )
nazwa = mapa
end
)
-- S SIDE
addEvent ( "PotrzebujeNazwy" , true )
addEventHandler ( "PotrzebujeNazwy" , root , function()
local nazwa = getMapName ()
triggerClientEvent ( client , "OtrzymujeszNazwe" , client , nazwa )
end
)
Powinno lata?
Wysłany: 2016-04-25, 17:42
Xaar
Wiek: 25 Na forum: 5450 dni Posty: 47
Nick w MP: PLWESOLYKOSTEK
Piwa : 82
Tagi: getmapname
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: