Wysłany: 2017-02-04, 15:18
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
Witam mam problem z kodem wykonanym przez Malentasa chodzi o to ze jak wchodz? w marker ?eby mnie tp do int to mi wyskakuje gui za?o?enia organizacji pierwszy raz sie z takim b??dem spotykam wiec prosz? o pomoc z tym.
S:
local markerek = createMarker (- 218.43 , 1406.58 , 27.77 - 2 , "cylinder" , 1.5 , 128 , 160 , 0 )
setElementInterior ( markerek , 18 )
addEvent ( "zalozs" , true )
addEventHandler ( "zalozs" , root , function( nazwa )
if tonumber ( getElementData ( source , "player:hours" )) < 300 then
outputChatBox ( "Nie posiadasz 5h(300min) online" , source )
return
end
if getElementData ( source , "player:organization" ) then
outputChatBox ( "Posiadasz organizacje" , source )
return
end
if tonumber ( getPlayerMoney ( source )) < 99999 then
outputChatBox ( "Nie sta? cie na za?o?enie organizacji" , source )
return
end
takePlayerMoney ( source , 100000 )
setElementData ( source , "player:organization" , nazwa )
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_organizations SET uid=?, code=?, rank=?" , getElementData ( source , "player:uid" ), nazwa , "4" )
outputChatBox ( "Pomy?lnie za?o?y?e? organizacje o nazwie " .. nazwa .. " koszt 100000 PLN." , source , 0 , 255 , 0 )
end )
-------------------------------------------------------------------------------------------------------------------------------------------
wejscie = createMarker ( 693.61 , 1967.69 , 5.54 + 1 , "arrow" , 2 , 128 , 192 , 0 )
wyjscie = createMarker (- 229.29 , 1401.29 , 27.77 + 1 , "arrow" , 2 , 128 , 192 , 0 )
setElementInterior ( wyjscie , 18 )
addEventHandler ( "onMarkerHit" , wejscie , function( el , md )
if getElementType ( el ) == "player" then
if isPedInVehicle ( el ) then return end
setElementInterior ( el , 18 )
setElementPosition ( el , - 227.24 , 1401.03 , 27.77 )
end
end )
addEventHandler ( "onMarkerHit" , wyjscie , function( el , md )
if getElementType ( el ) == "player" then
if isPedInVehicle ( el ) then return end
setElementInterior ( el , 0 )
setElementPosition ( el , 693.65 , 1964.64 , 5.54 )
end
end )
C:
--[[
System tworzenia organizacji
@ author Malentas
@ dla gtao . pl
Zakaz usuwania autora !
]]
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize ()
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
podanaNazwa = guiCreateEdit ( 0.31 , 0.41 , 0.34 , 0.05 , "Nazwa" , true )
guiSetVisible ( podanaNazwa , false )
function gui ()
dxDrawRectangle ( screenW * 0.2889 , screenH * 0.1811 , screenW * 0.3931 , screenH * 0.4489 , tocolor ( 0 , 0 , 0 , 195 ), false )
dxDrawRectangle ( screenW * 0.2882 , screenH * 0.1722 , screenW * 0.3937 , screenH * 0.0556 , tocolor ( 14 , 0 , 201 , 255 ), false )
dxDrawText ( "Panel Zak?adania organizacji!" , screenW * 0.2882 , screenH * 0.1711 , screenW * 0.6819 , screenH * 0.2278 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "?eby za?o?y? organizacje musisz mie? 1200min czyli 20h i 10000 PLN" , screenW * 0.2882 , screenH * 0.1922 , screenW * 0.6819 , screenH * 0.3800 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "center" , "center" , false , false , false , false , false )
if isMouseIn ( screenW * 0.3243 , screenH * 0.5556 , screenW * 0.3194 , screenH * 0.0633 ) then
dxDrawRectangle ( screenW * 0.3243 , screenH * 0.5556 , screenW * 0.3194 , screenH * 0.0633 , tocolor ( 14 , 0 , 201 , 155 ), false )
else
dxDrawRectangle ( screenW * 0.3243 , screenH * 0.5556 , screenW * 0.3194 , screenH * 0.0633 , tocolor ( 14 , 0 , 201 , 255 ), false )
end
dxDrawText ( "Za??? organizacje" , screenW * 0.3236 , screenH * 0.5567 , screenW * 0.6438 , screenH * 0.6189 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( "onClientMarkerHit" , resourceRoot , function( el )
if el ~= localPlayer then return end
if isCursorShowing ( el ) then return end
addEventHandler ( "onClientRender" , getRootElement (), gui )
showCursor ( true , false )
guiSetVisible ( podanaNazwa , true )
end )
addEventHandler ( "onClientMarkerLeave" , resourceRoot , function( el )
if el ~= localPlayer then return end
removeEventHandler ( "onClientRender" , getRootElement (), gui )
showCursor ( false )
guiSetVisible ( podanaNazwa , false )
end )
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( sscreenW * 0.3236 , screenH * 0.5567 , screenW * 0.6438 , screenH * 0.6189 ) and guiGetVisible ( podanaNazwa ) then
local nazwa = guiGetText ( podanaNazwa )
if nazwa : len () < 1 then
outputChatBox ( "Nazwa organizacji powinna mie? minimum 1 liczbe" , localPlayer )
return
end
if nazwa : len () > 10 then
outputChatBox ( "Nazwa organizacji powinna mie? maksimum 10 liczb" , localPlayer )
return
end
triggerServerEvent ( "zalozs" , localPlayer , nazwa )
end
end
end )
Wysłany: 2017-02-04, 15:22
AssasiPlayGames
Wiek: 22 Na forum: 3757 dni Posty: 176
Nick w MP: NiFeKpL
Piwa : 909
STOPseba , daj mo?e int w nowym pliku
Więcej szczegółów
Wystawiono 1 piw(a):STOPseba
Wysłany: 2017-02-04, 15:23
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
"AssasiPlayGames" napisał/a :STOPseba , daj mo?e int w nowym pliku
Da?em i to samo by?o jakby by? taki problem to bym tu nie pisa?
Wysłany: 2017-02-04, 15:37
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4150 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Musisz przerobi? kod, aby po wej?ciu w marker triggerowa? na client, albo przenie?? marker na client. addEventHandler ( "onClientMarkerHit" , resourceRoot , function( el )
if el ~= localPlayer then return end
if isCursorShowing ( el ) then return end
addEventHandler ( "onClientRender" , getRootElement (), gui )
showCursor ( true , false )
guiSetVisible ( podanaNazwa , true )
end )
addEventHandler ( "onClientMarkerLeave" , resourceRoot , function( el )
if el ~= localPlayer then return end
removeEventHandler ( "onClientRender" , getRootElement (), gui )
showCursor ( false )
guiSetVisible ( podanaNazwa , false )
end ) resourceRoot powoduje dzia?anie na ca?y zas?b. Malentas nie ma do?wiadczenia nie powinien si? bra? za co? o czym nie ma poj?cia.
Więcej szczegółów
Wystawiono 1 piw(a):STOPseba
Tagi: organizacje :: itp
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: