-LUA & XML Varkhal / Addoner

Status
Zamknięty.

buchaLL

bez spiny, luźno
Przyjaciel forum
Dołączył
Sierpień 2, 2011
Posty
1013
Liczba reakcji
68
Wiek
29
Witam, poszukuj? skryptu na Varkhala / Addonera ( 7.92 XML ), kt?ry b?dzie sprzedawa? addony za cc, lecz nie w ca?o?ci, tylko ka?dy addon ( first , second) ka?dego outfitu pojedynczo.
Czy jest kto? w stanie co? takiego napisa? ?
Czy mo?e kto? taki skrypt posiada ?

Z g?ry dzi?ki za pomoc :)
 
Odp: Varkhal / Addoner

@Od?wie?am
 
Odp: Varkhal / Addoner

@Od?wie?am
 
Odp: Varkhal / Addoner

@Od?wie?am.
 
Odp: Varkhal / Addoner

@Od?wie?am.
Prosz? o pomoc.
 
Odp: Varkhal / Addoner

@Od?wie?am
 
Odp: Varkhal / Addoner

A posiadasz ju? w silniku jakiego? npc, kt?ry daje te addony?
Je?li masz to zapodaj skrypt, przerobi si? go, je?li nie to mo?e co? napisze do jutra.
 
Odp: Varkhal / Addoner

Jasne, ?e mam :P Tylko, ?e ten sprzedaje wszystkie first/second addony. A chcia?bym, ?eby sprzedawa? 1 addon first/addon za 1cc. :)

Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Zegnaj.')
          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('Witaj ' .. creatureGetName(cid) .. '! Sprzedaje first addon za 10cc oraz second addon za 15cc.')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! jestem zajety, porozmawiamy za chwile.')

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

		if msgcontains(msg, 'first addon') then
			selfSay('Czy na pewno chcesz kupic first addon za 10cc?')
			talk_state = 1

		elseif msgcontains(msg, 'second addon') then
			selfSay('Czy na pewno chcesz kupic first addon za 15cc?')
			talk_state = 2	
		
		elseif talk_state == 1 then
			if msgcontains(msg, 'yes') then
				if pay(cid,10000) then
					addon(cid, 1)
				else
					selfSay('Nie masz wystarczajaco pieniedzy.')
				end
 			end
			talk_state = 0

		elseif talk_state == 2 then
			if msgcontains(msg, 'yes') then
				if pay(cid,15000) then
					addon(cid, 2)
				else
					selfSay('Nie masz wystarczajaco pieniedzy.')
				end
 			end
			talk_state = 0
			
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Zegnaj, ' .. 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('Nastepny...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Zegnaj.')
 			focus = 0
 		end
 	end
end
 
Odp: Varkhal / Addoner

Spr?buj tego:
PHP:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Zegnaj.')
          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('Witaj ' .. creatureGetName(cid) .. '! Sprzedaje first addon za 1c.')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! jestem zajety, porozmawiamy za chwile.')

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

		if msgcontains(msg, 'first addon') then
			selfSay('Czy na pewno chcesz kupic first addon za 1cc?')
			talk_state = 1
		
		elseif talk_state == 1 then
			if msgcontains(msg, 'yes') then
				if pay(cid,1000) then
					addon(cid, 1)
				else
					selfSay('Nie masz wystarczajaco pieniedzy.')
				end
 			end
			talk_state = 0
			
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Zegnaj, ' .. 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('Nastepny...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Zegnaj.')
 			focus = 0
 		end
 	end
end

Lecz je?li ta funkcja dzia?a addon(cid, 1) to wtedy powinno dzia?a?.
 
Odp: Varkhal / Addoner

Widz?, ?e nie zrozumia?e? co ja chc? :/
Chc? tak. Gdy napisze do Addonera - hi - > first assassin addon - > yes to, ?eby kosztowa?o to 1cc. Hi - > second assassin addon - > yes 1cc.
I tak dalej, ka?dy addon osobno.

Prosz? o pomoc. :)
 
Odp: Varkhal / Addoner

@Od?wie?am.
 
Odp: Varkhal / Addoner

@Od?wie?am.

Prosz? o pomoc. :)
 
Odp: Varkhal / Addoner

@Od?wie?am.
 
Odp: Varkhal / Addoner

Wszystkie addony, dla ka?dego outfitu za 1cc?
 
Odp: Varkhal / Addoner

np. first assassin addon - 1cc, second assassin addon 1cc
Itd. prosze o pomoc. :)
 
Odp: Varkhal / Addoner

@Odswiezam
 
Odp: Varkhal / Addoner

W weekend Ci go napisz? i umieszcz? w edicie, wi?c ju? spami? refreshami wi?cej nie musisz. ^ ^
Chyba, ?e mnie kto? wyprzedzi to okej.
 
Status
Zamknięty.
Back
Do góry