Wysłany: 2014-06-30, 15:08
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Witam! Pisz? skin shop od zera i mam problem. Nie wiem jak zrobi? aby wszystko wy?wietla?o si? po wej?ciu w marker. Za pomoc
Strony serwera nie mam, i zastanawiam si? czy inni b?d? widzieli mojego skina?
Kod: Sklep = {
gridlist = {},
staticimage = {},
button = {}
}
Sklep . button [ 1 ] = guiCreateButton ( 784 , 350 , 117 , 35 , "Zakup" , false )
Sklep . button [ 2 ] = guiCreateButton ( 784 , 408 , 117 , 35 , "Zamknij" , false )
Sklep . gridlist [ 1 ] = guiCreateGridList ( 378 , 279 , 176 , 248 , false )
guiGridListAddColumn ( Sklep . gridlist [ 1 ], "Skiny" , 0.9 )
guiGridListSetItemText ( Sklep . gridlist [ 1 ], 0 , 1 , "Garnitur" , false , false )
guiGridListSetItemText ( Sklep . gridlist [ 1 ], 1 , 1 , "Miejskie" , false , false )
guiGridListSetItemText ( Sklep . gridlist [ 1 ], 2 , 1 , "Diler" , false , false )
guiSetVisible ( Sklep . button [ 1 ], false )
guiSetVisible ( Sklep . button [ 2 ], false )
guiSetVisible ( Sklep . gridlist [ 1 ], false )
function tlo ()
dxDrawRectangle ( 368 , 269 , 553 , 268 , tocolor ( 0 , 0 , 0 , 227 ), false )
dxDrawText ( "Sklep Skin" , 530 , 246 , 755 , 287 , tocolor ( 255 , 255 , 255 , 255 ), 1.30 , "bankgothic" , "left" , "top" , false , false , true , false , false )
end
function( player )
if ( local player == getLocalPlayer ()) then
addEventHandler ( "onClientRender" , root , tlo , true )
guiSetVisible ( Sklep . button [ 1 ], true )
guiSetVisible ( Sklep . button [ 2 ], true )
guiSetVisible ( Sklep . gridlist [ 1 ], true )
function wyjscie ()
guiSetVisible ( Sklep . button [ 1 ], false )
guiSetVisible ( Sklep . button [ 2 ], false )
guiSetVisible ( Sklep . gridlist [ 1 ], false )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , Sklep . button [ 2 ], wyjscie , false )
function onClick ()
local wyb = guiGridListGetItemText ( Sklep . gridlist [ 1 ], guiGridListGetSelectedItem ( Sklep . gridlist [ 1 ]), 1 )
if wyb == "Garnitur" then
Sklep . staticimage [ 1 ] = guiCreateStaticImage ( 589 , 329 , 142 , 124 , "img/163.png" , false )
setPlayerSkin ( localPlayer , 163 )
end
end
addEventHandler ( "onClientGUIClick" , Sklep . gridlist [ 1 ], onClick , false )
function onClick ()
local wyb = guiGridListGetItemText ( Sklep . gridlist [ 1 ], guiGridListGetSelectedItem ( Sklep . gridlist [ 1 ]), 1 )
if wyb == "Miejskie" then
Sklep . staticimage [ 1 ] = guiCreateStaticImage ( 589 , 329 , 142 , 124 , "img/217.png" , false )
setPlayerSkin ( localPlayer , 217 )
end
end
addEventHandler ( "onClientGUIClick" , Sklep . gridlist [ 1 ], onClick , false )
function onClick ()
local wyb = guiGridListGetItemText ( Sklep . gridlist [ 1 ], guiGridListGetSelectedItem ( Sklep . gridlist [ 1 ]), 1 )
if wyb == "Gangsterskie" then
Sklep . staticimage [ 1 ] = guiCreateStaticImage ( 589 , 329 , 142 , 124 , "img/291.png" , false )
setPlayerSkin ( localPlayer , 291 )
end
end
addEventHandler ( "onClientGUIClick" , Sklep . gridlist [ 1 ], onClick , false )
Wysłany: 2014-06-30, 15:11
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
if ( local player == getLocalPlayer ()) then
Co to jest ?
Dam Ci m?j skin shop kt?ry robi?em ale nie przyda? mi si? :
C-side :
mojeW , mojeH = 640 , 480
sW , sH = guiGetScreenSize ()
width , height = ( sW / mojeW ), ( sH / mojeH )
-- Okno g ?? wne
okno_glowne = guiCreateWindow ( 247 * width , 79 * height , 236 * width , 322 * height , "Ubrania Copyright @ PanMaszyna" , false )
guiWindowSetSizable ( okno_glowne , false )
guiSetVisible ( okno_glowne , false )
grid = guiCreateGridList ( 25 * width , 35 * height , 186 * width , 209 * height , false , okno_glowne )
column = guiGridListAddColumn ( grid , "ID" , 1 )
button_ok = guiCreateButton ( 25 * width , 252 * height , 82 * width , 37 * height , "Za??? ( 1500$ )" , false , okno_glowne )
button_close = guiCreateButton ( 129 * width , 252 * height , 82 * width , 37 * height , "Zamknij" , false , okno_glowne )
label = guiCreateLabel ( 85 * width , 294 * height , 146 * width , 22 * height , "FunnyPlaying™ 1.0" , false , okno_glowne )
guiLabelSetHorizontalAlign ( label , "center" , false )
guiLabelSetVerticalAlign ( label , "center" )
marker_wejscia = createMarker ( - 316.65417 , 1075.10742 , 18.58669 , "cylinder" , 2 , 255 , 0 , 255 )
addEventHandler ( "onClientMarkerHit" , root , function ( elementWejsciowy , _ , _ )
if getLocalPlayer () ~= elementWejsciowy then return end
guiSetVisible ( okno_glowne , true )
showCursor ( true )
liczba = 0
guiGridListClear ( grid )
for i = 1 , 299 do
liczba = liczba + 1
row = guiGridListAddRow ( grid )
guiGridListSetItemText ( grid , row , column , liczba , false , false )
end
ped = createPed ( 0 , - 2521.98120 , - 653.86517 , 147.90631 , 60 )
setElementData ( ped , "ubrania" , true )
setCameraMatrix ( - 2525.11426 , - 653.52155 , 147.90631 , - 2522.45166 , - 654.48364 , 147.90631 )
end )
addEventHandler ( "onClientGUIClick" , root , function()
if source == button_close then
guiSetVisible ( okno_glowne , false )
showCursor ( false )
setCameraTarget ( getLocalPlayer (), getLocalPlayer () )
for _ , v in ipairs ( getElementsByType ( "ped" )) do
if getElementData ( v , "ubrania" ) then
destroyElement ( v )
end
setElementFrozen ( getLocalPlayer (), true )
setTimer ( setElementFrozen , 1000 , 1 , getLocalPlayer (), false )
end
elseif source == grid then
wybrany_row , wybrany_Col = guiGridListGetSelectedItem ( grid )
id = guiGridListGetItemText ( grid , wybrany_row , wybrany_Col )
if id == "" then return end
setElementModel ( ped , tonumber ( id ) )
elseif source == button_ok then
wybrany_row1 , wybrany_Col1 = guiGridListGetSelectedItem ( grid )
id_skina = guiGridListGetItemText ( grid , wybrany_row1 , wybrany_Col1 )
triggerServerEvent ( "zaloz" , getLocalPlayer (), id_skina )
end
end )
s-side :
addEvent ( "zaloz" , true )
addEventHandler ( "zaloz" , root , function ( id_skina )
id = tonumber ( id_skina )
kasa = getPlayerMoney ( source )
if kasa < 1500 then
outputChatBox ( "[DM] PanMaszyna : Nie posiadasz 1500 $." , source , 255 , 255 , 255 )
return end
setElementModel ( source , id )
takePlayerMoney ( source , 1500 )
outputChatBox ( "[DM] PanMaszyna : Ubranie zmienione. Mo?esz wyj??." , source , 255 , 255 , 255 )
end )
Wysłany: 2014-06-30, 15:34
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
PanMaszyna , Piwo masz, ale mi tu chodzi?o aby?cie mi poprawili to co jest ?le. Poniewa? chcia?bym nie u?ywa? guiCreate tylko dxDraw jako t?o..
Wysłany: 2014-06-30, 15:47
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
To zmie? na Swoje Ale oczywi?cie dopasuj pod rozdzielczo?? bo w tamtym kodzie nie by?o.
Tagi: skin :: shop
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: