• 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!

Help Script Rep ++

FabianoBN

l|¬¬"|l
Joined
Jan 23, 2009
Messages
745
Reaction score
22
Location
Goias - Brazil
Help, please someone help me?
I have a script addon doll, I'm just trying to get to when someone uses the command addon doll, doll out the addon, and also add some Storage Value.
Only put, and not adding.
Can anyone help me?

Script:
PHP:
function onSay(cid, words, param)
    local female = { 
    ["citizen"]={136, 10001}, 
    ["hunter"]={137, 10003}, 
    ["mage"]={138, 10007}, 
    ["knight"]={139, 10005}, 
    ["nobleman"]={140, 10015}, 
    ["summoner"]={141, 10009}, 
    ["warrior"]={142, 10019}, 
    ["barbarian"]={147, 10011}, 
    ["druid"]={148, 10013}, 
    ["wizard"]={149, 10021}, 
    ["oriental"]={150, 10017}, 
    ["pirate"]={155, 10027}, 
    ["assassin"]={156, 10023}, 
    ["beggar"]={157, 10025}, 
    ["shaman"]={158, 10029}, 
    ["norsewoman"]={252, 10031}, 
    ["nightmare"]={269, 10037}, 
    ["jester"]={270, 10033}, 
    ["brotherhood"]={279, 10039}, 
    ["demonhunter"]={288, 10035}, 
    ["yalaharian"]={324, 10041} 
    }
    local male = { 
    ["citizen"]={128, 10001}, 
    ["hunter"]={129, 10003}, 
    ["mage"]={130, 10007}, 
    ["knight"]={131, 10005}, 
    ["nobleman"]={132, 10015},
    ["summoner"]={133, 10009}, 
    ["warrior"]={134, 10019}, 
    ["barbarian"]={143, 10011}, 
    ["druid"]={144, 10013}, 
    ["wizard"]={145, 10021}, 
    ["oriental"]={146, 10017}, 
    ["pirate"]={151, 10027}, 
    ["assassin"]={152, 10023}, 
    ["beggar"]={153, 10025}, 
    ["shaman"]={154, 10029}, 
    ["norsewoman"]={251, 10031}, 
    ["nightmare"]={268, 10037}, 
    ["jester"]={273, 10033}, 
    ["brotherhood"]={278, stor = 10039}, 
    ["demonhunter"]={289, 10035}, 
    ["yalaharian"]={325, 10041} 
    }
    local msgs = {
    "Incorrect param!", 
    "You need Addon Doll!", 
    "Incorrect param!", 
    "Addon sucesfully added!",
    "You already have this addon!"
    }
    local param = string.lower(param)     
 if(getPlayerItemCount(cid, 8982) > 0) then
   if (getPlayerStorageValue(cid, male[param][2]) ~= -1) then                   
      if(param ~= "" and male[param] and female[param]) then
            doPlayerRemoveItem(cid, 8982, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msgs[4])
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)                        
            if(getPlayerSex(cid) == 0) then
              doPlayerAddOutfit(cid, female[param][1], 1)          
            else
              doPlayerAddOutfit(cid, male[param][1], 1)           
            end
            setPlayerStorageValue(cid, male[param][2], 1)
        end
        else
          doPlayerSendCancel(cid, msgs[5])
  end
       else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msgs[2])
    end
  return TRUE
end

Who help me, I give Rep++

Thanks!!
 
PHP:
function onSay(cid, words, param) 
    local female = {  
    ["citizen"]={136, 10001},  
    ["hunter"]={137, 10003},  
    ["mage"]={138, 10007},  
    ["knight"]={139, 10005},  
    ["nobleman"]={140, 10015},  
    ["summoner"]={141, 10009},  
    ["warrior"]={142, 10019},  
    ["barbarian"]={147, 10011},  
    ["druid"]={148, 10013},  
    ["wizard"]={149, 10021},  
    ["oriental"]={150, 10017},  
    ["pirate"]={155, 10027},  
    ["assassin"]={156, 10023},  
    ["beggar"]={157, 10025},  
    ["shaman"]={158, 10029},  
    ["norsewoman"]={252, 10031},  
    ["nightmare"]={269, 10037},  
    ["jester"]={270, 10033},  
    ["brotherhood"]={279, 10039},  
    ["demonhunter"]={288, 10035},  
    ["yalaharian"]={324, 10041}  
    } 
    local male = {  
    ["citizen"]={128, 10001},  
    ["hunter"]={129, 10003},  
    ["mage"]={130, 10007},  
    ["knight"]={131, 10005},  
    ["nobleman"]={132, 10015}, 
    ["summoner"]={133, 10009},  
    ["warrior"]={134, 10019},  
    ["barbarian"]={143, 10011},  
    ["druid"]={144, 10013},  
    ["wizard"]={145, 10021},  
    ["oriental"]={146, 10017},  
    ["pirate"]={151, 10027},  
    ["assassin"]={152, 10023},  
    ["beggar"]={153, 10025},  
    ["shaman"]={154, 10029},  
    ["norsewoman"]={251, 10031},  
    ["nightmare"]={268, 10037},  
    ["jester"]={273, 10033},  
    ["brotherhood"]={278, stor = 10039},  
    ["demonhunter"]={289, 10035},  
    ["yalaharian"]={325, 10041}  
    } 

    local setStorage = 4555
    local msgs = { 
    "Incorrect param!",  
    "You need Addon Doll!",  
    "Incorrect param!",  
    "Addon sucesfully added!", 
    "You already have this addon!" 
    } 
    local param = string.lower(param)      
 if(getPlayerItemCount(cid, 8982) > 0) then 
   if (getPlayerStorageValue(cid, male[param][2]) ~= -1) then                    
      if(param ~= "" and male[param] and female[param]) then 
            doPlayerRemoveItem(cid, 8982, 1) 
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msgs[4]) 
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)                         
            if(getPlayerSex(cid) == 0) then 
              doPlayerAddOutfit(cid, female[param][1], 1)           
            else 
              doPlayerAddOutfit(cid, male[param][1], 1)            
            end 
            setPlayerStorageValue(cid, male[param][2], 1) 
        end 
        else 
          doPlayerSendCancel(cid, msgs[5]) 
  end 
       else 
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msgs[2]) 

        if(isPlayer(cid) == TRUE and getPlayerStorageValue(cid, setStorage) ~= 1) then
                doPlayerSetStorageValue(cid, setStorage, 1)
                return TRUE
        end
        if(isPlayer(cid) == TRUE and getPlayerStorageValue(cid, setStorage) == 1) then
                return TRUE
        end
        if(isPlayer(cid) ~= TRUE) then
                return FALSE
        end
  return TRUE 
end

rep++ i tried to help u :D
 
friend's command, adding the storage that is it in config?

there has
local female = (
[ "citizen"] = (136, 10001),

Citizen is the name of the outfit.
136 is the number of outift.
10001 is the storage of outfit, because that is how storage is the npc.
 
Christ.. even John Nash would have trouble deciphering that reply...

But maybe try: doCreatureSetStorage(uid, key, value). Or maybe you could actually say what fails with your script?
 
Back
Top