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

Prison Guard [8.1]

Status
Zamknięty.

Agacik

User
Dołączył
Czerwiec 28, 2008
Posty
19
Liczba reakcji
1
Autor:Johan

Na sam pocz?tek tworzymy w data/npc/scripts plik prison.lua

Wklejamy tam to:

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

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) < 15 then
		if isPremium(cid) then
			selfSay('Hello ' .. creatureGetName(cid) .. ' , Pay me 100k to get out of prison, say pay to get out.')
			focus = cid
			talk_start = os.clock()
		else
			selfSay('Only Premium players can get out of prison.')
			focus = 0
			talk_start = 0
		end

  	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, 'pay') then
			if pay(cid,100000) then
				selfSay('Let\'s go!')
				selfSay('/send ' .. creatureGetName(cid) .. ', 1000 1000 7')
				focus = 0
				talk_start = 0
			else
				selfSay('Ha, you dont have enough money, you filthy thif!')
			end

		elseif msgcontains(msg, 'out') then
			if pay(cid,450) then
				selfSay('Let\'s go!')
				selfSay('/send ' .. creatureGetName(cid) .. ', [B]1000[/B],[B]1000[/B],[B]7[/B] ')
				focus = 0
				talk_start = 0
			else
				selfSay('Ha, you dont have enough money, you filthy thif!')
			end

		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. ' Lets hope we dont see you again.')
			focus = 0
			talk_start = 0
		end
	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
  	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) > 15 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end

Tekst pogrubiony oznacza to gdzie gracz ma by? przenisiony

Nast?pnie tworzymy w data/npc plik Prison Guard.xml

HTML:
<?xml version="1.0"?>

<npc name="Prison Guard" script="data/npc/scripts/prison.lua" access="3">
	<health now="1" max="1"/>
	<look type="131" head="95" body="95" legs="95" feet="95" corpse="3128"/>
</npc>


Z wi?zienia w ten spos?b bez odsiadywania kary mo?e wykupi? si? gracz z PACC'em.
Koszt: 10cc.
Wiadomo??: Hi>pay.
Mi?ego korzystania:p
 
Hehe skrypcik jest spoko:P Na pewno mi si? przyda. Wko?cu nie b?d? musia? pami?ta? o wyci?ganiu ludzi z wi?zienia xD Jescze raz dzi?ki.
 
Kas? trzeba mie? przy sobie, czy z depo te? bierze automatycznie??
 
Aha... No to troch? lipa, bo nie ka?dy nosi przy sobie 10 cc i nie b?dzie si? m?g? wykupi?. Pozostanie mu odczekanie kary.
 
He he ladny skrypcik xD napewno mi sie przyda obym nie zapomnial wyciagnac niektorych z paki :P
 
Pro?ba

Pro?ba

Czy mo?e kto? przerobi? ten skrypt tak aby mo?na by?o p?aci? kas? z depo???
 
HaHA! ja jednak wole bany;D
@up ja nie niestety nie wiem jak to przerobic choc spr?buje ale trzeba cos
pokombinowac (chyba) z tym:
if msgcontains(msg, 'pay') then
if pay(cid,100000) then

//Prosz? bardzo, mo?e i tego polubisz =)
 
Ostatnio edytowane przez moderatora:
Nawet niezly tylko pamietac trzeba tez o miejscu ktore nie jest pogrubione a dokladnie o wspolrzednych teleportu gracza kiedy bedzie mial kase i napisze "pay" ;] Zastanowie sie czy go jeszcze uzyc na serwerze ale byc moze.... :D ;)
 
Podoba mi si? !
Czego? takiego szuka?em :)
Mo?na zrobi? jeszcze tak ?e gracz z PACC i Promocj? mo?e wyj?? za 10cc?
 
Odp: Pro?ba

Odp: Pro?ba

To nie dzia?a jak wsadzam kogo? do budy i pisze przy mnie hi to npc muwi:
12:32 Prison Guard:Hello Lolek Zdzislawek i can help you!
I lolek pisze pay o npc nic
Prosze o pomoc
 
Status
Zamknięty.
Do góry