Cronox Aportadores
Posts : 15 Points : 39 Reputation : 0 Join date : 14/07/2012
| Tema: Dar item a un player con comando Sáb Jul 14, 2012 6:24 pm | |
| te vas a data/talkactions/scripts copias un archivo lua lo renombras con daritem.lua borras lo que hay adentro y pegas esto : - Código:
-
function onSay(cid, words, param) if (param == "") then doPlayerSendCancel(cid, "Es necesario el nombre de un player,y el item") return TRUE end p = string.explode(param, ",") local player = getPlayerByName(p[1]) local ret = RETURNVALUE_NOERROR local tmp = getCreaturePosition(player) if player then else doPlayerSendCancel(cid, "Este player no existe.") return TRUE end local create = tonumber(p[2]) if not create then create = getItemIdByName(p[2], FALSE) if(create == LUA_ERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este item não existe.") return TRUE end end local countitem = 100 if (p[3]) then countitem = p[3] end local item = doCreateItemEx(create, countitem) if(p[4] and getBooleanFromString(p[4]) == TRUE) then if(p[5] and getBooleanFromString(p[5]) == TRUE) then tmp = getPlayerLookPos(player) end ret = doTileAddItemEx(tmp, item) else ret = doPlayerAddItemEx(player, item, TRUE) end if(ret ~= RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O ID: " .. p[2].." no existe.") else doSendMagicEffect(getCreaturePosition(player), 13) doSendMagicEffect(getCreaturePosition(cid), 12) doCreatureSay(player, "Usted recibio este item departe de ".. getCreatureName(cid) .. " :D", TALKTYPE_ORANGE_1) -- aqui el mensaje que recibira al llegar el item
return TRUE end return true end [code Ahora vamos a talkactions.xml y pegamos esto : [/code] - Código:
-
| |
|
Cronox Aportadores
Posts : 15 Points : 39 Reputation : 0 Join date : 14/07/2012
| Tema: Re: Dar item a un player con comando Sáb Jul 14, 2012 6:25 pm | |
| Ahora vamos a talkactions y pegamos esto : - Código:
-
<talkaction log="yes" access="5" words="/daritem" event="script" value="daritem.lua"/> | |
|
Darkens Administrador
Premios :
Posts : 52 Points : 163 Reputation : 2 Join date : 09/07/2012 Location : Two
| Tema: Re: Dar item a un player con comando Lun Jul 16, 2012 8:53 am | |
| - Citación :
Movido Razón: no es su categoría | |
|
Contenido patrocinado
| Tema: Re: Dar item a un player con comando | |
| |
|