Teddy
SweStream.se
Does anyone have a scripts that if u press on a item u get all outfits and all addons ?
eace:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1800) == 10 then
doCreatureSay(cid, "You already have all the addons.", TALKTYPE_ORANGE_1)
elseif getPlayerLevel(cid) >= 10 then
doCreatureSay(cid, "You received the first addon and the second addon.", TALKTYPE_ORANGE_1)
doPlayerAddAddons(cid, 3)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,20)
else
doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1800) == 10 then
doCreatureSay(cid, "You have already received all the addons!", TALKTYPE_ORANGE_1)
elseif getPlayerLevel(cid) > 10 then
doCreatureSay(cid, "You received the first addons and the second addons.", TALKTYPE_ORANGE_1)
doPlayerAddAddons(cid, 3)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,20)
else
doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
end
return TRUE
end
That would bug if you're level 10.
Fixed:
LUA:function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid,1800) == 10 then doCreatureSay(cid, "You have already received all the addons!", TALKTYPE_ORANGE_1) elseif getPlayerLevel(cid) > 10 then doCreatureSay(cid, "You received the first addons and the second addons.", TALKTYPE_ORANGE_1) doPlayerAddAddons(cid, 3) doSendMagicEffect(fromPosition, 37) doRemoveItem(item.uid) setPlayerStorageValue(cid,1800,20) else doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1) end return TRUE end
getPlayerStorageValue(cid, 1800) == 10
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLever(cid) == 10 then
doCreatureSay(cid, "You have already received all the addons!", TALKTYPE_ORANGE_1)
elseif getPlayerLevel(cid) > 10 then
doCreatureSay(cid, "You received the first addons and the second addons.", TALKTYPE_ORANGE_1)
doPlayerAddAddons(cid, 3)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,20)
else
doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
end
return TRUE
end
Umm, I don't exactly understand why you have
Code:getPlayerStorageValue(cid, 1800) == 10
-1, 1, and 0?
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1800) == -1 and getPlayerLevel(cid) > 10 then
doCreatureSay(cid, "You received the first addon and the second addon.", TALKTYPE_ORANGE_1)
doPlayerAddAddons(cid, 3)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,1)
else
doCreatureSay(cid, "You already have all the addons or you are not level 10 and above.", TALKTYPE_ORANGE_1)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 1800) == -1 and getPlayerLevel(cid) > 10 then
doCreatureSay(cid, "You received the first addon and the second addon.", TALKTYPE_ORANGE_1)
doPlayerAddAddons(cid, 3)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,1)
else
doCreatureSay(cid, "You already have all the addons or you are not level 10 and above.", TALKTYPE_ORANGE_1)
end
return TRUE
end