Reklama
Pokazuje wyniki od 1 do 4 z 4

Temat: skrypt promtion

  1. #1

    Data rejestracji
    2018
    Posty
    28
    Siła reputacji
    0

    Domyślny skrypt promtion

    Witam
    mam prośbę mógłby ktoś przerobić skrypt promotion tak aby można było kupić dopiero gdy ma się premium ?
    Kod:
    function onSay(cid, words, param)
    if not isPremium(cid) then
    if doPlayerRemoveMoney(cid, 20000) == TRUE then
    if getPlayerStorageValue(cid, 2217) ~= 1 then
    doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
    setPlayerStorageValue(cid,2217, 1)
    else
    doPlayerSendCancel(cid, "Masz juz Promotion!.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    else
    doPlayerSendCancel(cid, "Musisz miec premium!.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    else
    doPlayerSendCancel(cid, "Nie masz 2 crystal coins.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    doPlayerSendCancel(cid, "Nie masz premium!.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end

  2. #2

    Notoryczny Miotacz Postów ochmar jest teraz offline
    Avatar ochmar
    Data rejestracji
    2017
    Posty
    1,281
    Siła reputacji
    7

    Domyślny

    if not isPremium(cid) then
    zmień na
    if isPremium(cid) then
    ?
    To TFS 0.3/0.4?

    EDIT:
    Dobra, bo się pogubiłeś w ifach i elsach:
    Kod:
    function onSay(cid, words, param)
    	if isPremium(cid) then
    		if getPlayerStorageValue(cid, 2217) ~= 1 then
    			if doPlayerRemoveMoney(cid, 20000) == TRUE then
    				doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
    				setPlayerStorageValue(cid,2217, 1)
    			else
    				doPlayerSendCancel(cid, "Nie masz 2 crystal coins.")
    				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    			end
    		else
    			doPlayerSendCancel(cid, "Masz juz Promotion!.")
    			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    
    		end
    	else
    		doPlayerSendCancel(cid, "Nie masz premium!.")
    		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    	end
    end

  3. Reklama
  4. #3

    Data rejestracji
    2018
    Posty
    28
    Siła reputacji
    0

    Domyślny

    Wersja xml aries, muszę przerabiać.
    Teraz odczytuje jakby cały czas nie miał premium.
    korzystam ze skryptu npc i tam jest

    elseif not isPremium(cid) then

    local focus = 0
    local talk_start = 0
    local target = 0
    local days = 0

    function onThingMove(creature, thing, oldpos, oldstackpos)

    end


    function onCreatureAppear(creature)

    end


    function onCreatureDisappear(cid, pos)
    if focus == cid then
    selfSay('Good bye then.')
    focus = 0
    talk_start = 0
    end
    end


    function onCreatureTurn(creature)

    end


    function msgcontains(txt, str)
    return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
    end


    function onCreatureSay(cid, type, msg)
    msg = string.lower(msg)

    if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
    selfSay('Hello ' .. creatureGetName(cid) .. '! I sell premiums and promotions.')
    focus = cid
    talk_start = os.clock()

    elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
    selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

    elseif focus == cid then
    talk_start = os.clock()

    if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
    if getPlayerVocation(cid) > 4 then
    selfSay('Sorry, you are already promoted.')
    talk_state = 0
    elseif getPlayerLevel(cid) < 20 then
    selfSay('Sorry, you need level 20 to buy promotion.')
    talk_state = 0
    elseif not isPremium(cid) then
    selfSay('Sorry, you must be premium to buy promotion.')
    talk_state = 0
    else
    selfSay('Do you want to buy promotion for 20k?')
    talk_state = 1
    end

    elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
    selfSay('Do you want to buy 90 days of premium for 7k?')
    talk_state = 2

    elseif talk_state == 1 then
    if msgcontains(msg, 'yes') then
    if pay(cid,20000) then
    doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
    selfSay('You are now promoted!')
    else
    selfSay('Sorry, you do not have enough money.')
    end
    end
    talk_state = 0

    elseif talk_state == 2 then
    if msgcontains(msg, 'yes') then
    if pay(cid,7000) then
    selfSay('/premium '.. creatureGetName(cid) ..', 90')
    selfSay('You have 90 days of premium more!')
    else
    selfSay('Sorry, you do not have enough money.')
    end
    end
    talk_state = 0

    elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
    selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
    focus = 0
    talk_start = 0
    end
    end
    end


    function onCreatureChangeOutfit(creature)

    end


    function onThink()
    doNpcSetCreatureFocus(focus)
    if (os.clock() - talk_start) > 30 then
    if focus > 0 then
    selfSay('Next Please...')
    end
    focus = 0
    end
    if focus ~= 0 then
    if getDistanceToCreature(focus) > 5 then
    selfSay('Good bye then.')
    focus = 0
    end
    end
    end

  5. #4

    Data rejestracji
    2018
    Posty
    28
    Siła reputacji
    0

    Domyślny

    zmieniłem tak jak napisałeś i działa if isPremium(cid) then
    dzięki wielkie sam się pogubiłem
    leci rep

Reklama

Informacje o temacie

Użytkownicy przeglądający temat

Aktualnie 1 użytkowników przegląda ten temat. (0 użytkowników i 1 gości)

Podobne tematy

  1. [8.54][SKRYPT]Skrypt NPC+Zabijanie potworka
    Przez Morgahar w dziale Strefa developerska
    Odpowiedzi: 4
    Ostatni post: 17-04-2010, 17:16
  2. [8.54][Elf]Uleczenie parala gdy nie ma potwora[skrypt]
    Przez nielimitowany w dziale Tibia
    Odpowiedzi: 3
    Ostatni post: 16-04-2010, 16:52
  3. [7.6] Skrypt do areny
    Przez sofcik w dziale Strefa developerska
    Odpowiedzi: 1
    Ostatni post: 09-03-2010, 03:20
  4. Odpowiedzi: 1
    Ostatni post: 28-01-2010, 15:06
  5. Jaki skrypt wybrac na strone
    Przez wrzasq w dziale Tibia
    Odpowiedzi: 22
    Ostatni post: 23-10-2007, 18:30

Tagi tego tematu

Zakładki

Zakładki

Zasady postowania

  • Nie możesz pisać nowych tematów
  • Nie możesz pisać postów
  • Nie możesz używać załączników
  • Nie możesz edytować swoich postów
  •