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

weapon premium

movents ^^
<movevent type="Equip" itemid="666" event="script" value="premitem1.lua"/>

LUA:
function onEquip(cid, item, slot)
	if(slot = 5 or slot = 6) then--Right / Left Hand
		if (not isPremium(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This item is for premium players only!")
		return false
		end
	end
end
 
you will get a crash if you receive this item directly in hand, either by buying from NPC or trading with another player or using /i as gamemaster :p
LUA:
function onEquip(cid, item, slot)
	if (slot == CONST_SLOT_RIGHT or slot == CONST_SLOT_LEFT) and not isPremium(cid) then
		return not doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'This item is for premium players only!')
	end
	return true
end
don't say you weren't warned
 
Last edited:
not much i can do here, i'm not so good at c++ & it's a source issue :p

tried to debug it and it seems to screw up somewhere here
[cpp]uint32_t MoveEvent::executeEquip(Player* player, Item* item, slots_t slot)
{
//onEquip(cid, item, slot)
//onDeEquip(cid, item, slot)
if(m_interface->reserveEnv())
{
ScriptEnviroment* env = m_interface->getEnv();[/cpp]
 

Similar threads

Replies
3
Views
487
Back
Top