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

Skrypt

Soul_Bullock

New Member
Joined
May 4, 2011
Messages
53
Reaction score
1
Skrypt znalazłem tutaj na forum. Aby go uzywać potrzebny jest vip. Może ktoś go przerobić (albo podpowiedzieć jak) tak aby mógł go uzyuwać gracz tylko z Premium Acc?
PHP:
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
 if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    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

Nie wiem czy to duzo pracy czy nie, ale chyba stroage nie bd potrzebne. Kompletnie tego nie ogarniam ;/ Podpowie/Pomoże ktoś?
I jak zrobić żeby ta runa nie była potrzebna do aktywacji tylko samo posiadanie pacca było aktywacją (gdy pacc sie skończy nie może juz uzywać tej komendy) I nie wiem czy byłoby możliwe, że gdy napisze "!XXx (komende zmienie juz sobie sam)" to pojawi sie lista z lokacjami, tak żebynie musiał wpisywać recznie??
 
Last edited:
Kompletnie nie wychodzi ;// mógłby ktos to wstawić? i jak pousuwać to, że vip i item(do aktywacji) potrzebny??
 
Pokaż co zrobiłeś, to poprawie ci. I plus log z błędem w konsoli.
 
Lua:
if getPlayerStorageValue(cid, vip) < 1 then 
     doPlayerSendCancel(cid, "You must be a vip player to use this command.") 
   return TRUE 
 end

na

Lua:
if not isPremium(cid) then 
     doPlayerSendCancel(cid, "You must be a premium player to use this command.") 
return true 
end
 
Skrypt wygląda tak
PHP:
local places = {
   ["temple"] = {position = {x=1005, y=999, z=7}, level = 1},
   ["depot"] = {position = {x=96, y=118, z=7}, level = 8},
   ["hutning"] = {position = {x=90, y=119, z=7}, level = 10}
}
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 not isPremium(cid) then 
     doPlayerSendCancel(cid, "You must be a premium player 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
 if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendCancel(cid, "Sorry, you have a battle sign")
   return TRUE
 end
 
 if IsPlayerPremium(cid) == 1 then
    doTeleportThing(cid, tp.position)
    doSendMagicEffect(getPlayerPosition(cid), 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You teleported to ".. param .." !")
   return TRUE
 end
end

Jak jest pz to pojawia się że nie mogę tp, jak nie wpisze nazwy to też, jak nie ma pacca to też nie wykona tp (Czyli dobrze)
Jednak gdy spełnia wymagania to się nic nie dzieję :p CO mam źle?
 
Spróbuj tego:

Lua:
local places = { 
   ["temple"] = {position = {x=1005, y=999, z=7}, level = 1}, 
   ["depot"] = {position = {x=96, y=118, z=7}, level = 8}, 
   ["hutning"] = {position = {x=90, y=119, z=7}, level = 10} 
} 
function onSay(cid, words, param) 
    local tp = places[param] 
    if (param == "") then           
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Write a position you want to be teleported to.") 
    end 
  
	if not isPremium(cid) then  
		return doPlayerSendCancel(cid, "You must be a premium player to use this command.")  
	end 
	if getPlayerLevel(cid) < tp.level then 
		return doPlayerSendCancel(cid, "Sorry, only players level " ..tp.level.. " can use this command.") 
	end 
	if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then 
		return doPlayerSendCancel(cid, "Sorry, you have a battle sign") 
	end 
	if isPremium(cid) then 
    doTeleportThing(cid, tp.position) 
    doSendMagicEffect(getPlayerPosition(cid), 10) 
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You teleported to ".. param .." !") 
    end
return true
end
 
Dopiero teraz zobaczylem że ktos odpisał, o dziwo taki sam skrypt wyszedl mi ;p jednak gdy ktos wpisze złą lokacje np "!tp tempel" zamiast "!tp temple" to pojawia sie bład w consoli (nie przeszkada to w graniu) ale zaśmieca mi konsole. jak to naprawić?
PHP:
[20/05/2012 10:55:49] [Error - TalkAction Interface] 
[20/05/2012 10:55:49] data/talkactions/scripts/tp.lua:onSay
[20/05/2012 10:55:49] Description: 
[20/05/2012 10:55:49] data/talkactions/scripts/tp.lua:15: attempt to index local 'tp' (a nil value)
[20/05/2012 10:55:49] stack traceback:
[20/05/2012 10:55:49] 	data/talkactions/scripts/tp.lua:15: in function <data/talkactions/scripts/tp.lua:6>
 
here you are, I made some small modifications

Lua:
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

	if(getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
		doPlayerSendCancel(cid, "Sorry, you cannot perform this action for aslong as you\'re in a battle.")
		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
 
Back
Top