• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Cycek nie daje amuletu

Status
Not open for further replies.

marcinek99097

Banned User
Joined
Feb 6, 2010
Messages
588
Reaction score
4
Location
Poland/Dg
Siema

Code:
    -- XVX FORGER START --
     
    function amulet(cid, message, keywords, parameters, node)
        if(not npcHandler:isFocused(cid)) then
            return false
        end
            if doPlayerRemoveItem(cid,8262, 1) and doPlayerRemoveItem(cid,8263,1) and doPlayerRemoveItem(cid,8264,1) and doPlayerRemoveItem(cid,8265, 1) and doPlayerRemoveMoney(cid) >= 5000 then
     
    doPlayerRemoveItem(cid, 8262, 1) 
    doPlayerRemoveItem(cid, 8263, 1) 
    doPlayerRemoveItem(cid, 8264, 1)
    doPlayerRemoveItem(cid, 8265, 1) 
    doPlayerRemoveMoney(cid,5000)
    doPlayerAddItem(cid, 8266, 1)
                selfSay('Here is your item!', cid)
     
            else
                selfSay('You don\'t have all items or cash!', cid)
        end
    end

Co w tym jest źle ? mam 4 częsci amuletu + 5k i cycek nie chce dać amuletu a zabiera all..?
 
Mejbi

Code:
if getPlayerItemCount(cid,8262) >= 1 and getPlayerItemCount(cid,8263) >= 1 and getPlayerItemCount(cid,8264) >= 1 and  getPlayerItemCount(cid,8265) >= 1 then
        if doPlayerRemoveItem(cid,8262,1) and doPlayerRemoveItem(cid,8263,1) and doPlayerRemoveItem(cid,8264,1) and  doPlayerRemoveItem(cid,8265,1) then
            npcHandler:say('masz ziomal!', cid)
            doPlayerAddItem(cid,8266,1)
        end
        else
            npcHandler:say('nie masz itemow', cid)
    end
end
 
LOLOLOLOLOL

robicie if doPlayerRemoveItem..
A nie sprawdzacie czy wykonało prawdę.. bo może to zwrócić warunek true or false
więc jak już to
if doPlayerRemoveItem() == TRUE ..

Jeśli robisz if do playerremoveitem to już potem nie dawaj by 2 raz usuwało

polecam zrobić tak:

if getPlayerItemCount(cid, item1) > count1 ... then
doPlayerRemoveItem(cid, item1, count1)...
doPlayerAddItem(cid, itemad, itemadcount)
selfSay('Prosze bardzo to Twoj amulet', cid)
 
LOLOLOLOLOL

robicie if doPlayerRemoveItem..
A nie sprawdzacie czy wykonało prawdę.. bo może to zwrócić warunek true or false
więc jak już to
if doPlayerRemoveItem() == TRUE ..

Jeśli robisz if do playerremoveitem to już potem nie dawaj by 2 raz usuwało

polecam zrobić tak:

if getPlayerItemCount(cid, item1) > count1 ... then
doPlayerRemoveItem(cid, item1, count1)...
doPlayerAddItem(cid, itemad, itemadcount)
selfSay('Prosze bardzo to Twoj amulet', cid)

A zdajesz sobie sprawe, ze to:
Code:
if doPlayerRemoveItem(cid, 1234) == true then

Znaczy dokladnie to samo, co to:
Code:
if doPlayerRemoveItem(cid, 1234) then
 
A zdajesz sobie sprawe, ze to:
Code:
if doPlayerRemoveItem(cid, 1234) == true then

Znaczy dokladnie to samo, co to:
Code:
if doPlayerRemoveItem(cid, 1234) then

właśnie myślałem czy tak jest, ale nie byłem pewien, dzięki :)

#Szysza
Po co sprawdzasz najpierw czy ma item, a potem czy go usunęło? nie potrzebny kawałek, ale jak tam wolicie
 
Status
Not open for further replies.
Back
Top