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

group id x/ on use

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Reaction score
36
Location
Canada
Hi there, i need a action when
player use item, then do group id x.

is it possible?

ty in advance
 
Last edited:
If you're still looking for this:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local newGroupID = 3
	
	doPlayerSetGroupId(cid, newGroupId)
	
	return true 
end
 
Create in data/actions/scripts this acessitem.lua

PHP:
local config = {
	group_id = ID,
	id_item = xxxx
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	if item.itemid == config.id_item then
	doPlayerSetGroupId(cid, config.group_id)
	doPlayerSendTextMessage(cid, 22, 'Your group id is '.. config.group_id ..'!')
end
	return true
end

In actions.xml
Add
PHP:
<action itemid="xxxx" script="acessitem.lua"/>


Configure:
ID = Group ID LOL
xxxx = ID Item


=D
 
Last edited:
If you're still looking for this:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local newGroupID = 3
	
	doPlayerSetGroupId(cid, newGroupId)
	
	return true 
end

Nice, decent work.

Create in data/actions/scripts this acessitem.lua

PHP:
local config = {
	group_id = ID,
	id_item = xxxx
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	if item.itemid == config.id_item then
	doPlayerSetGroupId(cid, config.group_id)
	doPlayerSendTextMessage(cid, 22, 'Your group id is '.. config.group_id ..'!')
end
	return true
end

In actions.xml
Add
PHP:
<action itemid="xxxx" script="acessitem.lua"/>


Configure:
ID = Group ID LOL
xxxx = ID Item


=D
Cool one , hope this helps XD
 
Back
Top