Postado Março 11, 2016 9 anos Fala trutas! Firmeza total! Então, deixo aqui pra vocês um script que eu uso e acho muito útil para todos gms, cms e gods. Essa talkaction é usada para dar um item ao jogador ou remover o item dele; você não vai precisar mais ir até o player, criar o item e entregá -lo. Vamos ao código: Em Talkaction/scripts/ Crie um arquivo chamado "dip_rip" com extensão "lua", ficando assim: Citar dip_rip.lua Agora, adicione esse código dentro dele: Citar --[[( Marcryzius )]]-- local MSCB = MESSAGE_STATUS_CONSOLE_BLUE function dip (cid,item,quant) local uid = doCreateItemEx(item,quant) local get = getThing(uid) if(get.type > 0)then if(doPlayerAddItemEx(cid,uid) == false)then return false,'The player can not receive the item {'..getItemNameById(item)..'} because not have space.' end elseif(uid and getItemNameById(item))then for _= 1,quant do if(doPlayerAddItem(cid,item,1,false) == false)then return false end end else return false,'Item not found!' end return true end function rip (cid,item,quant) if(doPlayerRemoveItem(cid,item,quant) == false)then return false end return true end function onSay(cid, words, param) if(param == "") then return true,doPlayerSendTextMessage(cid,MSCB, "Command param required.")end local C,t = {},string.explode(param, ",") C.ret = RETURNVALUE_NOERROR C.tmp = getCreaturePosition(cid) C.amount = (t[3] == nil) and 1 or tonumber (t[3]) C.nameitem = (tonumber(t[2]) == nil) and t[2] or getItemNameById(t[2]) C.id = (tonumber(t[2]) == nil) and getItemIdByName(t[2]) or tonumber(t[2]) C.pid = getPlayerByNameWildcard(t[1]) if(C.id == LUA_ERROR)then return true,doPlayerSendTextMessage(cid,MSCB, "Item wich such name or id does not exists.")end if(C.pid == 0 or (isPlayerGhost(C.pid) == true and getPlayerAccess(C.pid) > getPlayerAccess(cid))) then return true,doPlayerSendTextMessage(cid,MSCB, "Player " .. param .. " is not currently online.") end if(words == '/rip')then if(rip(C.pid,C.id,C.amount) == false)then doPlayerSendTextMessage(cid,MSCB, "the player ("..getCreatureName(C.pid)..") does not have that item ("..C.nameitem..") or the quantity of them ("..C.amount..").") else doPlayerSendTextMessage(cid,MSCB,"was removed from the player ("..getCreatureName(C.pid)..") of the item name ("..C.nameitem..") and Item Id ("..C.id..") in the amount of "..C.amount..".") end else local bool,msg = dip(C.pid,C.id,C.amount) if(bool == false)then doPlayerSendTextMessage(cid,MSCB,msg) else doPlayerSendTextMessage(cid,MSCB, "The player ("..getCreatureName(C.pid)..") received the item, ("..C.nameitem..") and Id ("..C.id..") in the amount of ("..C.amount..").") doPlayerSendTextMessage(C.pid,MSCB, "You have received the item, ("..C.nameitem..") in the amount of ("..C.amount..") to the ("..getPlayerGroupName(cid)..") ("..getCreatureName(cid)..").") end end return true end Agora em talkaction/talkactions.xml Adicione essa tag: Citar <talkaction log="yes" words="/dip;/rip" access="3" event="script" value="dip_rip.lua"/> É isso ae galera, espero que vocês curtam o sistema.
Postado Março 11, 2016 9 anos Tópico aprovado, obrigado por compartilhar. ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 25, 2016 8 anos Qual é o comando não consegui usar... para usa-lo seria /dip nome id (item)??? ou tem que ter algo explica ae pf???
Postado Julho 25, 2016 8 anos @warlley Tente assim: /dip nome do player, id, quantidade Ex: /dip Matheus, 1234, 1 Obs: Se lhe ajudei, de um REP+ :D
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.