Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function give()
- if isPlayer(cid) == 1 then -- if it's a player then
- doPlayerAddItem(cid, 2195, 1) -- add an item to the player. In this case ONE pair of BOH
- elseif not isPlayer(cid) == 1 then -- else if it's not a player
- doPlayerSendTextMessage(cid, 22, "Only players can get items") -- Sends message to player 22 = green text
- else
- doPlayerSendCancel(cid, "Sorry, not possible.") -- If none of the statements is correct, send cancel message to player
- end -- this "end" close the "if"
- return true -- this function can be used because it return true
- end -- closes the function give()
- -- Another thing
- if item.itemid == 1000 then
- doShit()
- elseif item.itemid == 1001 then
- doOtherShit()
- elseif item.itemid == 1002 then
- doSomeOtherShit()
- end
- -- As you can see inside the "if" to the "end" you can use elseif statement how ever you want
- if item.itemid == 1000 then -- Starter IF
- if getPlayerItemCount(cid, 2000) >= 1 then -- use if else end inside a started if
- doSomeFuckingShit()
- else
- send("You don't have that item of id 2000")
- end
- elseif item.itemid == 1001 then
- if getPlayerItemCount(cid, 2001)
- doSomeMoreShitFFS()
- else
- send("You don't have that item of id 2001")
- end
- end -- closes the first if
Add Comment
Please, Sign In to add comment