• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Aukcje offline

Status
Zamknięty.
Odp: Aukcje offline

ech...
Gelio
Dosta?e? zap?at? od nich wi?c nie powiniene? si? czepia? nawet gdyby upublikowali to. A ?e to stworzy? inny autor to tym bardziej.( A tak przy okazji ile dosta?e? za ten skrypt?)

Widzia?em to i chcia?em napisa? w request ale ju? nie musz? dzi?ki wam.
 
Odp: Aukcje offline

Aragornikk,
Trzymaj ca?y login.lua . Masz go podmieni? i b?dzie ?miga?:)

Kod:
local config = { 
	loginMessage = getConfigValue('loginMessage')
}
function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end
local auction = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
if(auction:getDataInt("auction_balance") > 0) then
doPlayerAddMoney(cid, auction:getDataInt("auction_balance"))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold item on auction, you get " .. auction:getDataInt("auction_balance") .. " gps.")
db.executeQuery("UPDATE `players` SET `auction_balance` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
auction:free()
end
	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
	return true

end

Pozdrawiam
 
Odp: Aukcje offline

Batonek, ?ap auctionsystem.lua ;)

Kod:
 --[[
        Offline player to player item trader (Auction System) by vDk
                Script version: 1.1b
]]--
local config = {
        levelRequiredToAdd = 20,
        maxOffersPerPlayer = 3,
        SendOffersOnlyInPZ = false,
        blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933}
        }
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
       
        local t = string.explode(param, ",")
        if(t[1] == "add") then
                if((not t[2]) or (not t[3]) or (not t[4])) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                        return true
                end
               
                if(not tonumber(t[3]) or (not tonumber(t[4]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")
                        return true
                end
               
                if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")
                        return true
                end
               
                local item = getItemIdByName(t[2], false)
                if(not item) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
                        return true
                end
               
                if(getPlayerLevel(cid) < config.levelRequiredToAdd) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")
                        return true
                end
                               
                if(isInArray(config.blocked_items, item)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")
                        return true
                end
               
                if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item.")
                        return true
                end
               
                local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")
                if(check:getID() == -1) then
                elseif(check:getRows(true) >= config.maxOffersPerPlayer) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")
                        return true
                end
                               
                if(config.SendOffersOnlyInPZ) then    
                        if(not getTilePzInfo(getPlayerPosition(cid))) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")
                                return true
                        end
                end
           
                if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")
                        return true
                end
       

                doPlayerRemoveItem(cid, item, (tonumber(t[4])))
                db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. t[4] .. ", " .. t[3] ..", " .. os.time() .. ")")
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. t[4] .." " .. t[2] .." for " .. t[3] .. " gps to offerts database.")
        end
       
        if(t[1] == "buy") then
                if(not tonumber(t[2])) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                        return true
                end
               
                local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")
                if(buy:getID() ~= -1) then
                        if(getPlayerMoney(cid) < buy:getDataInt("cost")) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")
                                                                buy:free()
                                return true
                        end
                       
                        if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.")
                                                                buy:free()
                                return true
                        end
                       
                        if(isItemStackable((buy:getDataString("item_id")))) then
                                doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count"))
                        else
                                for i = 1, buy:getDataInt("count") do
                                        doPlayerAddItem(cid, buy:getDataString("item_id"), 1)
                                end
                        end
                       
                        doPlayerRemoveMoney(cid, buy:getDataInt("cost"))
                        db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You buy " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!")
                       
                        local seller = getPlayerByNameWildcard(getPlayerNameByGUID(buy:getDataInt("player")))
                        if(seller) then
                                doPlayerAddMoney(seller, buy:getDataInt("cost"))
                                doPlayerSendTextMessage(seller, MESSAGE_INFO_DESCR, "Someone buy your " .. buy:getDataString("item_name") .. ". You get " .. buy:getDataInt("cost") .. " gps.")
                        else
                                db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";")
                        end
                        buy:free()
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                end
        end
       
        if(t[1] == "remove") then
                if((not tonumber(t[2]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                        return true
                end
               
                local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")        
                if(delete:getID() ~= -1) then
                        if(getPlayerGUID(cid) == delete:getDataInt("player")) then
                                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                                if(isItemStackable(delete:getDataString("item_id"))) then
                                        doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count"))
                                else
                                        for i = 1, delete:getDataInt("count") do
                                                doPlayerAddItem(cid, delete:getDataString("item_id"), 1)
                                        end
                                end
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.")
                        else
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")
                        end
                                                delete:free()
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                end
        end
        return true
end

Pozdrawiam
 
Odp: Aukcje offline

Je?eli macie bl?d typu

Kod:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\auctionsystem.php on line 20

Rozwi?zanie jest proste w skrypcie jest b??d i prosze by autor tematu go usun?? znajduj? si? on(oto ten fragment):

Kod:
<a href="?subtopic=characters&name='.urlencode($[COLOR="Red"]aucti on[/COLOR]['name']).'">'.$auction['name']

Jak wida? tutaj na czerwono jest spacja aucti on kt?r? trzeba usun?? i b?dzie ?adnie chodzi?, przypominam o opcji pom?g? x)))
 
Odp: Aukcje offline

k1ngus1a15, na cholere to dajesz?! Zobacz sobie ten post ! Przeczytaj ca?y temat zanim napiszesz niepotrzebny post...

A teraz zg?aszam :)

Pozdrawiam!
 
Odp: Aukcje offline

Tacy jak ty zawsze robia Ctrl C plus Ctrl V i ciesz? si? z tego co maj? ja to wiem ;P zero intencji tw?rczych jak zg?osi?e? do Modernatora to git niech usunie ten post i tw?j bo tylko sobie posty nabijasz...

a napisane by?o to po to by autor poprawi? t? linijke skryptu bo pewnie nie wiedzia? gdzie jest b??d

;) pzdr
 
Jak doda? to do bazy danych?
Cytat:
ALTER TABLE `players` ADD `auction_balance` INT( 11 ) NOT NULL DEFAULT '0';
Cytat:
CREATE TABLE `auction_system` (
`id` int(11) NOT NULL auto_increment,
`player` int(11),
`item_id` int(11),
`item_name` varchar(255),
`count` int(11),
`cost` int(11),
`date` int(11),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Pomo?e mi kto? ? :(
 
Ostatnio edytowane przez moderatora:
Odp: Aukcje offline

Na g??wnej stronie bazy danych z ot wejd? w zak?adk? SQL i tam wklej.

Pozdrawiam,
Sassin
 
Ostatnia edycja:
Odp: Aukcje offline

Od d?ugiego czasu poszukiwa?em tego skryptu, nie mog?em go znale?c dzi?ki wielkie ze go tu da?e?. Przetestowa?em u mnie dzia?a w 100% moja ocena 5/5 :thx:
 
Odp: Aukcje offline

nie wiem gdzie mam doda? ta linijkie do latouya i nawet nie wiem co mam mie? w images\items
 
Odp: Aukcje offline

#up
To mo?e dok?adnie poczytaj co napisa?em... A w "images\items" masz mie? obrazki itemk?w :) Je?li nie bd umia? ich znale?? to daj mi zna? na Gadu-Gadu.

Pozdrawiam,
Sassin
 
Status
Zamknięty.
Do góry