Witam mam do was pro?b? m?g?by kto? sprawdzi? czy dobrze napisany jest ten skrypt bo co? mi nie dzia?a jak chc? stworzy? organizacj? co do bazy danych to mam wszystko podpi?te tabela i kolumny pod skrypt zrobione
tutaj macie skrypt:
addEvent('organization:create',true)
addEventHandler('organization:create',resourceRoot,function(name)
local check = exports['pystories-db']:dbGet('select * from ms_organizacje where code=?',name)
if check[1] then outputChatBox('Podana nazwa organizacji jest ju? zaj?ta!',client) return end
if string.len(name) < 3 then outputChatBox('Nazwa organizacji jest zbyt kr?tka.',client) return end
local create = exports['pystories-db']:dbSet('insert into ms_organizacje (code, login, uid, actived, rank) values(?,?,?,now(),4)',tostring(name),getElementData(client,'player:nickname'),getElementData(client,'player:sid'))
if create then
outputChatBox('Pomy?lnie stworzy?e? organizacj? o nazwie: '..name..'!',client)
setElementData(client,'player:organization',tostring(name))
takePlayerMoney(client,15000000)
else outputChatBox('Wyst?pi? b??d, zg?o? go administracji.',client) end
end)
|