Wysłany: 2016-07-14, 10:44
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
Mam problem chodzi o to ze mam gui pod f6 i jak wpisze tam Kod z sms (jest w Config.xml) to ma mi sie pokaza? : Zakupi?es Premium na 30dni a jak klikam Wy?lij to wysakuje mi DB3
SklepSMS\c . lua : 101 : Bad argument @ ' GuiSetText (expectated giu-elemt at argument 1, got nill) Przepisywa?em wi?c mog? byc drobne b??dy
Kod:
Client:
GUIEditor = {
gridlist = {},
button = {},
label = {},
edit = {}
}
sklepitem = {
{ "Premium" , "30" , "dni" , "Chcesz kupi?? zg?os sie do Administracji" },
}
sklep = guiCreateWindow ( 141 , 119 , 600 , 475 , "Sklep Serwerowy" , false )
GUIEditor . label [ 15 ] = guiCreateLabel ( 10 , 390 , 580 , 30 , "" , false , sklep )
GUIEditor . label [ 16 ] = guiCreateLabel ( 10 , 430 , 580 , 30 , "Pamietaj: Admin nie odpowiada za ?le wys?anego smsa oraz nie zwraca pieni?dzy!\nsprawdz 10 razy na jaki numer i jaka tre?? ma SMS!" , false , sklep )
guiLabelSetHorizontalAlign ( GUIEditor . label [ 15 ], "center" )
guiLabelSetVerticalAlign ( GUIEditor . label [ 15 ], "center" )
guiLabelSetHorizontalAlign ( GUIEditor . label [ 16 ], "center" )
guiLabelSetVerticalAlign ( GUIEditor . label [ 16 ], "center" )
tabPanel = guiCreateTabPanel ( 10 , 20 , 580 , 370 , false , sklep )
TABA = guiCreateTab ( "Kup punkty" , tabPanel )
TABB = guiCreateTab ( "Premium" , tabPanel )
guiWindowSetSizable ( sklep , false )
lista = guiCreateGridList ( 10 , 35 , 550 , 90 , false , TABA )
ilosc = guiGridListAddColumn ( lista , "Ilo?? PP" , 0.24 )
koszt = guiGridListAddColumn ( lista , "Koszt SMS" , 0.24 )
tresc = guiGridListAddColumn ( lista , "Tre?? SMSA" , 0.24 )
numer = guiGridListAddColumn ( lista , "Numer" , 0.24 )
GUIEditor . label [ 11 ] = guiCreateLabel ( 15 , 10 , 400 , 20 , "Krok pierwszy: Wybierz na ile chcesz kupic premium" , false , TABA )
GUIEditor . label [ 12 ] = guiCreateLabel ( 15 , 130 , 400 , 20 , "Krok drugi: Wy?lij sms" , false , TABA )
GUIEditor . label [ 13 ] = guiCreateLabel ( 15 , 185 , 400 , 20 , "Krok trzeci: Wpisz otrzymany kod oraz kod antyspamowy" , false , TABA )
GUIEditor . label [ 14 ] = guiCreateLabel ( 15 , 265 , 400 , 20 , "Krok czwarty: Zatwierd? wpisany kod przyciskiem" , false , TABA )
guiLabelSetColor ( GUIEditor . label [ 11 ], 0 , 255 , 0 )
guiLabelSetColor ( GUIEditor . label [ 12 ], 0 , 255 , 0 )
guiLabelSetColor ( GUIEditor . label [ 13 ], 0 , 255 , 0 )
guiLabelSetColor ( GUIEditor . label [ 14 ], 0 , 255 , 0 )
GUIEditor . label [ 13 ] = guiCreateLabel ( 15 , 155 , 400 , 136 , "Numer:" , false , TABA )
GUIEditor . label [ 14 ] = guiCreateLabel ( 150 , 155 , 400 , 136 , "Tre??:" , false , TABA )
GUIEditor . label [ 2 ] = guiCreateLabel ( 15 , 210 , 100 , 16 , "Wpisz kod sms:" , false , TABA )
GUIEditor . edit [ 1 ] = guiCreateEdit ( 110 , 210 , 120 , 18 , "" , false , TABA )
GUIEditor . label [ 3 ] = guiCreateLabel ( 15 , 235 , 120 , 16 , "Przepisz kod:" , false , TABA )
GUIEditor . edit [ 2 ] = guiCreateEdit ( 160 , 235 , 120 , 18 , "" , false , TABA )
GUIEditor . label [ 4 ] = guiCreateLabel ( 90 , 235 , 60 , 16 , "LOSOWYKOD" , false , TABA )
guiEditSetMaxLength ( GUIEditor . edit [ 1 ], 8 )
guiEditSetMaxLength ( GUIEditor . edit [ 2 ], 8 )
GUIEditor . button [ 1 ] = guiCreateButton ( 10 , 290 , 560 , 45 , "Wyslij" , false , TABA )
guiSetVisible ( sklep , false )
for i , v in ipairs ( sklepitem ) do
local row = guiGridListAddRow ( lista )
guiGridListSetItemText ( lista , row , 1 , v [ 1 ], false , true )
guiGridListSetItemText ( lista , row , 2 , v [ 2 ], false , true )
guiGridListSetItemText ( lista , row , 3 , v [ 3 ], false , true )
guiGridListSetItemText ( lista , row , 4 , v [ 4 ], false , true )
end
function aktualizuj ( button , state , absoluteX , absoluteYe )
if ( source == lista ) then
if ( guiGridListGetSelectedItem ( lista )) then
local lol = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 1 )
local numer = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 4 )
local tresc = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 3 )
if lol == "10" then
guiSetText ( GUIEditor . label [ 13 ], "Numer: " .. numer .. "" )
guiSetText ( GUIEditor . label [ 14 ], "Tre??: " .. tresc .. "" )
elseif lol == "50" then
guiSetText ( GUIEditor . label [ 13 ], "Numer: " .. numer .. "" )
guiSetText ( GUIEditor . label [ 14 ], "Tre??: " .. tresc .. "" )
elseif lol == "100" then
guiSetText ( GUIEditor . label [ 13 ], "Numer: " .. numer .. "" )
guiSetText ( GUIEditor . label [ 14 ], "Tre??: " .. tresc .. "" )
elseif lol == "200" then
guiSetText ( GUIEditor . label [ 13 ], "Numer: " .. numer .. "" )
guiSetText ( GUIEditor . label [ 14 ], "Tre??: " .. tresc .. "" )
end
end
end
end
addEventHandler ( "onClientGUIClick" , lista , aktualizuj )
function wyslij ( button , state , absoluteX , absoluteYe )
if ( source == GUIEditor . button [ 1 ]) then
if ( guiGridListGetSelectedItem ( lista )) then
local lol = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 1 )
checka = guiGetText ( GUIEditor . edit [ 2 ])
checkb = guiGetText ( GUIEditor . label [ 4 ])
kod = guiGetText ( GUIEditor . edit [ 1 ])
if checka == checkb then
guiSetText ( GUIEditor . label [ 1 ], "Trwa weryfikacja" )
guiSetText ( GUIEditor . edit [ 2 ], "" )
losuj = math . random ( 1 , 99999999 )
guiSetText ( GUIEditor . label [ 4 ], losuj )
triggerServerEvent ( 'SprawdzPoprawnosc' , getLocalPlayer (), kod , lol )
else
guiSetText ( GUIEditor . label [ 1 ], "Podany kod jest nie prawid?owy. Sprawdz czy dobrze wpisa?es\a? jak nadal nie dza?a pisz do Administracji!" )
guiLabelSetColor ( GUIEditor . label [ 1 ], 255 , 0 , 0 )
setTimer ( function()
local lol = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 1 )
if lol == "50" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 6,15 z?). Otrzymasz zwrotny SMS z kodem" )
elseif lol == "100" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 12,27 z?). Otrzymasz zwrotny SMS z kodem" )
elseif lol == "200" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 23.37 z?). Otrzymasz zwrotny SMS z kodem" )
end
end , 5000 , 1 )
guiSetText ( GUIEditor . edit [ 2 ], "" )
losuj = math . random ( 1 , 999 )
guiSetText ( GUIEditor . label [ 4 ], losuj )
guiSetText ( GUIEditor . label [ 1 ], "Blednie przepisany kod!" )
setTimer ( function()
guiLabelSetColor ( GUIEditor . label [ 1 ], 255 , 255 , 255 )
end , 5050 , 1 )
end
end
end
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 1 ], wyslij )
bindKey ( "f6" , "down" , function()
if ( guiGetVisible ( sklep ) == false ) then
guiSetVisible ( sklep , true )
showCursor ( true )
losuj = math . random ( 10000000 , 99999999 )
guiSetText ( GUIEditor . label [ 4 ], losuj )
else
guiSetVisible ( sklep , false )
showCursor ( false )
end
end )
function INFORMACJA ( info , kolor )
guiSetText ( GUIEditor . label [ 1 ], info )
if kolor == "ZIELONY" then
guiLabelSetColor ( GUIEditor . label [ 1 ], 0 , 255 , 0 )
elseif kolor == "CZERWONY" then
guiLabelSetColor ( GUIEditor . label [ 1 ], 255 , 255 , 255 )
end
setTimer ( function()
local lol = guiGridListGetItemText ( lista , guiGridListGetSelectedItem ( lista ), 1 )
if lol == "50" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 6,15 z?). Otrzymasz zwrotny SMS z kodem" )
elseif lol == "100" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 12,27 z?). Otrzymasz zwrotny SMS z kodem" )
elseif lol == "200" then
guiSetText ( GUIEditor . label [ 1 ], "wy?lij SMS o tre?ci xxx na numer xxx\n(koszt: 23.37 z?). Otrzymasz zwrotny SMS z kodem" )
end
end , 5000 , 1 )
setTimer ( function()
guiLabelSetColor ( GUIEditor . label [ 1 ], 255 , 255 , 255 )
end , 5050 , 1 )
end
addEvent ( "INFO" , true )
addEventHandler ( "INFO" , getRootElement (), INFORMACJA )
Server:
function sprawdz ( kodpotw , ilosc )
local xml = xmlLoadFile ( "config.xml" )
if ilosc == "50" then
local xmlx = xmlFindChild ( xml , "KODA" , 0 )
local KOD = xmlNodeGetChildren ( xmlx )
for i , node in ipairs ( KOD ) do
kody = xmlNodeGetValue ( node )
if kody == kodpotw then
local target = exports [ "ogrpg-core" ]: findPlayer ( plr , cel )
if not target then
setPremiumDay ( target , dni )
outputChatBox ( "Kupi?e? Premium na 30dni" , source , 0 , 255 , 0 , true )
triggerEvent ( "save:player" , root , target )
triggerEvent ( "load:player" , root , target )
setElementData ( target , "player:premium" , true )
xmlDestroyNode ( node )
outputServerLog ( "GRACZ: " .. getPlayerName ( source ).. " kupi? Premium na 30 Dni" )
info = "Kupi?e? Premium na 30 dni ;)"
kolor = "ZIELONY"
triggerClientEvent ( source , "INFO" , root , info , kolor )
else
info = "Podany kod SMS jest niepoprawny!"
kolor = "CZERWONY"
triggerClientEvent ( source , "INFO" , root , info , kolor )
end
end
end
addEvent ( "SprawdzPoprawnosc" , true )
addEventHandler ( "SprawdzPoprawnosc" , getRootElement (), sprawdz )
Dodam ze Skrypt znalaz?em na gtao ale on nie dawa? premium tylko co? innego i chca?em przerobic pod premium
Piwko Oraz Repka
// Usune?em linike 101 i mam takie co?
Error : Client ( mixLoLmix ) triggerd serverside event SprawdzPoprawnosc , but vev is not added serverside
Wysłany: 2016-07-16, 10:55
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
mixLoLmix2 , nie masz labelu o takim indeksie GUIEditor.label[1]
Co do tego 2 b??du to mia?e? za ma?o end'?w
function sprawdz ( kodpotw , ilosc )
local xml = xmlLoadFile ( "config.xml" )
if ilosc == "50" then
local xmlx = xmlFindChild ( xml , "KODA" , 0 )
local KOD = xmlNodeGetChildren ( xmlx )
for i , node in ipairs ( KOD ) do
kody = xmlNodeGetValue ( node )
if kody == kodpotw then
local target = exports [ "ogrpg-core" ]: findPlayer ( plr , cel )
if not target then
setPremiumDay ( target , dni )
outputChatBox ( "Kupi?e? Premium na 30dni" , source , 0 , 255 , 0 , true )
triggerEvent ( "save:player" , root , target )
triggerEvent ( "load:player" , root , target )
setElementData ( target , "player:premium" , true )
xmlDestroyNode ( node )
outputServerLog ( "GRACZ: " .. getPlayerName ( source ).. " kupi? Premium na 30 Dni" )
info = "Kupi?e? Premium na 30 dni ;)"
kolor = "ZIELONY"
triggerClientEvent ( source , "INFO" , root , info , kolor )
end
else
info = "Podany kod SMS jest niepoprawny!"
kolor = "CZERWONY"
triggerClientEvent ( source , "INFO" , root , info , kolor )
end
end
end
end
addEvent ( "SprawdzPoprawnosc" , true )
addEventHandler ( "SprawdzPoprawnosc" , getRootElement (), sprawdz )
Tagi: sklep :: premium
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: