What's new

Switch Shop

Status
Not open for further replies.

Magmaruss

Active User
Joined
Jun 5, 2009
Messages
68
Reaction score
5
Na tym forum nie znalaz?em jeszcze dzia?aj?cego switch shopu, wi?c udost?pniam wam scrypt znaleziony na pewnym otsie poprawiony przez administracj? otfans.pl, poniewa? tu pomocy si? nie doczeka?em.
Tworzymy w silnik/data/actions/scripts plik o nazwie potki lub runy w formacie LUA
Wklejamy to :
function onUse(cid, item, frompos, item2, topos)
container = doPlayerAddItem(cid, 5926, 1)

if item.itemid == 1945 and doPlayerRemoveMoney(cid,4000) then

doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doTransformItem(item.uid,item.itemid+1)

elseif item.itemid == 1946 and doPlayerRemoveMoney(cid,4000) then
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doAddContainerItem(container, 8473, 7)
doTransformItem(item.uid,item.itemid-1)

else
doPlayerSendCancel(cid,"Sorry, you don't have enough money!")
end
return 1
end
5926 - id backpacka
1945 - wa?ne id d?wigni
4000 - koszt za backpack potek/run
8473 - id runki/potki
7 - ilo?? u?y? (ja dla potek ustawia?em 0 ale nie wiem czy w tym przypadku ma to jakie? znaczenie)
Jeszcze linijeczka do silnik/data/actions/actions.xml
<action uniqueid="numer unique" script="nazwa pliku kt?ry stworzyli?my.lua"/>
Na koniec w map ediotorze tworzymy d?wigni? o wy?ej podanym id, klikamy ppm, proporties i w uniques wpisujemy numer jaki podali?my w actions.xml
 

Gegos

User
Joined
Oct 19, 2008
Messages
10
Reaction score
0
Odp: Switch Shop

THX nareszcie mam ten skrypt, d?ugo go szuka?em. Pozdro dla ciebie i jeszcze raz WIELKIE THX
 
R

Rahim

Guest
Odp: Switch Shop

Skr?cona wersja:
Code:
local bpId = 2000  --id plecaka
local type = 1  --ustala typ kupowania. Przy 1 zabiera calosc od razu, przy 0 kupuje 1 potion pokolei.
local config = {  --[action id dzwigni] = {id_potionu,cena}
    [6710] = {7618,1000},
    [6711] = {7620,1000},
    [6712] = {7588,3000},
    [6713] = {7589,3000},
    [6714] = {7590,5000},
    [6715] = {7591,5000}
    }
function onUse(cid, item, frompos, item2, topos)
    if(config[item.actionid] == nil) then
        return FALSE
    end
    if(type == 1) then
        if(getPlayerMoney(cid) < config[item.actionid][2]) then
            doPlayerSendCancel(cid,"You don't have enought money!")
            return TRUE
        end
        doPlayerRemoveMoney(cid,config[item.actionid][2])
    end
    local bp = doPlayerAddItem(cid,bpId,1)
    for i = 1, 20 do
        if(type ~= 1) then
            if(getPlayerMoney(cid) < config[item.actionid][2]/20) then
                break
            end
            doPlayerRemoveMoney(cid,config[item.actionid][2]/20)
        end
        doAaddContainerItem(bp,config[item.actionid][1])
    end
    doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Bought "..i.." "..getItemName(config[item.actionid][1]).."s.")
    return TRUE
end
Mam nadziej?, ?e umiecie to odpowiednio skonfigurowa? (;
Skrypt uniwersalny, zast?pi kilkana?cie innych skrypt?w, bo w tym mo?esz ustawi?, ?eby z jednej d?wigni dostawa? np. bp sd, z drugiej bp uh itd.
 
Last edited:

Alf11

User
Joined
Aug 10, 2009
Messages
12
Reaction score
0
Odp: Switch Shop

w tym pierwszym skrypcie co? mi nie dzia?a ;)
dostaje pusty bp, nie zabiera kasy ;/
mozna to naprawi??

a przy tym drugim nic si? nie dzieje ;/
 
Last edited:

ozueld

User
Joined
May 21, 2008
Messages
11
Reaction score
1
Odp: Switch Shop

Co? mi nie dzia?a ; / dostaje bp z potkami ale gdy sko?czy mi sie kasa to bierze za free ;/
 

wagery12

Advanced User
Joined
Aug 8, 2008
Messages
197
Reaction score
5
Odp: Switch Shop

niezly skrypt wlasnei taki mam na swoim ots !! >>>>>><<<<< 9/10 pOLECAM
 
Status
Not open for further replies.
Top