Wysłany: 2016-02-12, 18:57
EseJax
Wiek: 31 Na forum: 4085 dni Posty: 67
Nick w MP: Toffy.
Piwa : 982
Cze??, mam pewien problem z account dat?, chce ustawi? ilo?? wpisan? w editboxa.
CLIENT
BANKGLOWNY = guiCreateWindow (( screenW - 530 ) / 2 , ( screenH - 367 ) / 2 , 530 , 367 , "BANKOMAT" , false )
Wplac = guiCreateButton ( 11 , 252 , 196 , 47 , "Wp?a?" , false , BANKGLOWNY )
TEXT = guiCreateEdit ( 11 , 194 , 507 , 48 , "Liczba.." , false , BANKGLOWNY )
guiEditSetMaxLength ( TEXT , 9 )
addEventHandler ( "onClientMarkerHit" , MarkerB , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= Player then return end
guiSetVisible ( BANKGLOWNY , true )
end )
addEventHandler ( "onClientGUIClick" , resourceRoot , function( el , md )
if source == Zamknij then
showCursor ( false )
guiSetVisible ( BANKGLOWNY , false )
end
if source == Wplac then
if el ~= Player then return end
local ilosc = guiGetText ( TEXT )
local numer = tonumber ( guiGetText ( TEXT ) )
if numer and ilosc then
triggerServerEvent ( "ustaw" , Player , "ilosc" )
outputChatBox ( "Wp?a?" )
else
outputChatBox ( "Podany text nie jest liczb?!" )
end
end
end )
SERVER
function asda ( thePlayer )
local konto = getPlayerAccount ( thePlayer )
if konto then
setAccountData ( konto , "pbankomath" , ilosc )
end
end
addEvent ( "ustaw" , true )
addEventHandler ( "ustaw" , resourceRoot , asda )
Wysłany: 2016-02-12, 19:03
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
triggerServerEvent ( source , "ustaw" , source , numer )
Graczem po triggerowaniu z c-side jest "source"
function asda ( numer )
local konto = getPlayerAccount ( source )
if konto then
setAccountData ( konto , "pbankomath" , numer )
end
end
addEvent ( "ustaw" , true )
addEventHandler ( "ustaw" , resourceRoot , asda )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-12, 19:06
EseJax
Wiek: 31 Na forum: 4085 dni Posty: 67
Nick w MP: Toffy.
Piwa : 982
Zrobi?em tak, po kliknieciu buttonu nic sie nie dzieje, nawet gdy wpisze jak?? literke nie pokazuje mi wiadomo?ci ?e jest nie prawid?owa.
Je?li mo?esz, przyjrzyj si? eventowi onClientGUIClick
Wysłany: 2016-02-12, 19:18
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Usu? to :
if el ~= Player then return end
(Znajduje si? to w funkcji klikni?cia w buttona)
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-13, 00:42
EseJax
Wiek: 31 Na forum: 4085 dni Posty: 67
Nick w MP: Toffy.
Piwa : 982
Czekam na dalsze propozycje..
Tagi: accountdata
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: