TalkAction advanced tp command for vip only + players buy it from shop)

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Best answers
0
Reaction score
181
*Don't tell me somone have done this script before cuz i am sure they did the first part, but here is mine.

ok,Some ot owners like to get more money not out of greedness but only to make sevrer run on dadicated so here is a way to make this command boughtable from shop.
I am using shawak's vip system http://otland.net/f81/release-vip-system-44986/
This command:
1-only player vip and who bought its item from shop can use it
2-can't use it if they have in battle sign(pz)
3-cancel msges suit player condition

so this will differ in the value of vip storage cause i am using shwak's vip system(if ind it the best) .
Add this in talkaction:
Code:
<talkaction words="!tp" event="script" value="tp.lua"/>
now we need to make to this command storage value so only player with this storage value can use it so will be like this.(idea from jdb script)
Code:
local places = {
   ["temple"] = {position = {x=95, y=117, z=7}, level = 7},
   ["depot"] = {position = {x=96, y=118, z=7}, level = 8},
   ["hutning"] = {position = {x=90, y=119, z=7}, level = 10}
}
local vip = 95883   ---- the vip storage u using shawak's vip system then it will be liek that
local nameoftpitem = "tp command rune"    --- name of the items player will by from shop
function onSay(cid, words, param)
    local tp = places[param]
    if (param == "") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Write a position you want to be teleported to.")
    return TRUE
    end
 
  if getPlayerStorageValue(cid, vip) < 1 then
     doPlayerSendCancel(cid, "You must be a vip player to use this command.")
   return TRUE
 end
 if getPlayerStorageValue(cid, 1156) ~= 1 and getPlayerStorageValue(cid, 95883) then
    doPlayerSendCancel(cid, "You must buy the "..nameoftpitem.." from shop to use this command.")
   return TRUE
 end
 if getPlayerLevel(cid) < tp.level then
    doPlayerSendCancel(cid, "Sorry,only players level " ..tp.level.. " can use this command.")
   return TRUE
 end
 [FONT=Courier New][FONT=Tahoma][COLOR=#00060a]if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then[/COLOR][/FONT][/FONT]
    doPlayerSendCancel(cid, "Sorry,you have a battle sign")
   return TRUE
 end
 
 if getPlayerStorageValue(cid, 1156) == 1 then
    doTeleportThing(cid, tp.position)
    doSendMagicEffect(getPlayerPosition(cid), 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You teleported to ".. param .." !")
   return TRUE
 end
end
now we need this command be used only by vip players and we need a item to put in shop to give players this storage value needed to use the command and we wilk make this item only use by vip players.
add in action.xml
Code:
<action itemid="2284" event="script" value="tp.lua"/>
make a file called tp.lua in the script in action folder and add this in it(by me )
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getPlayerStorageValue(cid, 9588) >= 1 then
      setPlayerStorageValue(cid, 1156, 1)
       doPlayerPopupFYI(cid, "Now you can use the tp command.Thank you for donating.")
      doRemoveItem(item.uid, 1)
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must be vip to use this item.")
   end
   return True
end
now all what you need is to add this item in your shop in site and have fun with cash$$. lol:p
And if somone think it is useless it isnot players did buy this item from me a lot it save time if you are away from you desired dstination or if you have gone like to the end of quest aand foorgot to make somthng so lol why the fuck would i go back again easy to kill myself :) so this here helps.

If i helped feel free to REp++:wub:
 
Last edited:

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
Code:
if isPlayerPzLocked == FALSE then
What the hell is it?
 
OP
Doggynub

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Best answers
0
Reaction score
181
srry i meant this mistake :p. i will fix sec
Code:
if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
 
Last edited:

Master-m

Need help? Just ask!
Joined
May 28, 2007
Messages
4,339
Best answers
0
Reaction score
15
Location
The Netherlands
I personally think that the actionscript should be replaced with a phpscript.(like unban):p
 
OP
Doggynub

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Best answers
0
Reaction score
181
:), yea lol.But it is cool too :p
 
OP
Doggynub

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Best answers
0
Reaction score
181
.......wrong post....
 
Top