Bom, eu prometi num tutorial postar um tutorial de como fazer um npc policial, mas é mas facil assim...
Começando...
1-Primeiro abra seu Map Editor junto com seu mapa e coloque a cadeia no lugar que voce desejar, tente fazer mais ou menos assim:
Link: http://img518.imageshack.us/img518/5489/tutocadeia1ei.jpg
Bom Depois de ter construido tudo, Tem que escolher o sistema que voce quer:
-Sistema Policial 10k(preço reajustável): Seria um sistema aonde se voce paga 10k ao policial voce sai da cadeia...
-Sistema de alerta by colex:(Link Aqui!) Que voce pode fazer que cada vez que a pessoa vai pra cadeia = 10% Alerta dai quando chegar ao 100% ja está no script que é banido, tem tudo explicado la.
-Normal System: Deixar a pessoa por 1 dia na cadeia(24horas[Tempo Reajustável])
Depois de escolher seu sistema, está na hora de criar os npcs Delegado, Policial, e se quiser o Advogado que voce paga 20k mais sai o alerta...
Seguem ai os npcs:
Policial:
Abra a pasta de Seu OTServ e Va em data\npc, copie um npc e cole, renomeie para Policial
Delete tudo e preencha com as seguintes informações:
<?xml version="1.0"?><npc name="Policial" script="data/npc/scripts/policial.lua" access="3"> <look type="131" head="114" body="88" legs="107" feet="114"/></npc>
Nota: Look Type é opcional
Agora va em scripts e copie a seguinte script:
-boat
Cole e renomeie para: policial
abra e delete tudo o que está lá dentro
e cole isso:
focus = 0talk_start = 0target = 0following = falseattacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos) if focus == cid then selfSay('Bem feito por estar preso seu mal educado.') focus = 0 talk_start = 0 endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hello') and (focus == 0)) and getDistanceToCreature(cid) < 3 then if isPremium(cid) then selfSay('O Que foi, ' .. creatureGetName(cid) .. '! Voce pode sair se me pagar 10k. Voce quer??') focus = cid talk_start = os.clock() else selfSay('Desculpe, Voce não tem dinheiro suficiente.') focus = 0 talk_start = 0 end elseif msgcontains(msg, 'hello') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Espera, ' .. creatureGetName(cid) .. '!') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'yes') then if pay(cid,10000) then selfSay('Espero que não volte mais!') selfSay('/send ' .. creatureGetName(cid) .. ', 160 54 7') focus = 0 talk_start = 0 else selfSay('Desculpe, voce não tem grana.') end elseif msgcontains(msg, 'ciieeeeeeeey') then if pay(cid,20) then selfSay('Let\'s go!') selfSay('/send ' .. creatureGetName(cid) .. ', 171 65 7') focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end endendfunction onCreatureChangeOutfit(creature)endfunction onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Que fale o próximo se tiver...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Tá Tá agora suma.') focus = 0 end endend
Nota: Aquele cieeeeey foi um erro não modifique,eu não modifiquei pois não tive tempo...
NPC: Delegado:
Em Andamento... Vou pedir um code a alguem, quem souber fazer codes me add no msn (rafix_sr@hotmail.com)
NPC: Advogado:
Ainda não implementado... Colex preciso falar com voce...
Bom Gente ta ai
Quando der eu Posto o rewsto dos Npcs la...