• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction /newtypeex (Change outfit to item ID)

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
742
Solutions
5
Reaction score
198
Location
Pr0land
GitHub
Erexo
Hello,
this is my simple script to change outfit :3

How to use?
Code:
/newtypeex ITEM ID
or
Code:
/newtypeex ITEM ID, PLAYER NAME

If you not set the player name, outfit will be on you.

Here we go!

talkactions.xml
XML:
	<talkaction log="yes" words="/newtypeex" access="4" script="newtypeex.lua"/>

newtypeex.lua
LUA:
function onSay(cid, words, param)

	if(param == "") then

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")

		return TRUE

	end



	local t = string.explode(param, ",")

	t[1] = tonumber(t[1])

	if(not t[1]) then

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")

		return TRUE
	end

	if(t[2]) then

		cid = getPlayerByNameWildcard(t[2])

		if(cid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")

			return TRUE

		end

	end

	tmp = t[1]
	doSetItemOutfit(cid, tmp, -1)
return TRUE
end

@EDIT

New command, set %hp :3

example:
Player "Noob" have full hp, when u use "/sethp 5, Noob", now have only 5% of hp :3
Its usefull to check bots, when player is in DP or something, set his hp to ~50%, and if he sudden use heal, he is a bot :P

talkactions.xml
XML:
	<talkaction log="yes" words="/sethp" access="4" script="sethp.lua"/>

sethp.lua
LUA:
function onSay(cid, words, param)
 
	if(param == "") then
 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
 
		return TRUE
 
	end
 
 
 
	local t = string.explode(param, ",")
 
	t[1] = tonumber(t[1])
 
	if(not t[1]) then
 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
 
		return TRUE
	end
 
	if(t[2]) then
 
		cid = getPlayerByNameWildcard(t[2])
 
		if(cid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
 
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
 
			return TRUE
 
		end
 
	end
 
	tmp = t[1]
	hape = tmp * 0.01
doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*hape - getCreatureHealth(cid)))
return TRUE
end

I think it will be helpfull for someone :3


Thanks,
Erexo.
 
Last edited:
Back
Top