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

Not Allowed to change outfit

Mooosie

mistofdeath.com
Premium User
Joined
Aug 2, 2008
Messages
742
Solutions
2
Reaction score
52
Location
Sweden
I am trying to make so the player can't change outfit via a GlobalEvent script:

LUA:
 local outfit = {lookType = 6, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
function onThink(interval, lastExecution, thinkInterval)
	if isPlayer(cid) then
		if getPlayerStorageValue(cid, 11113) == 1 then
			doCreatureChangeOutfit(cid, outfit, -1)
		end
	return true
	end
return true
end

XML:
	<globalevent name="ChangeOutfitBack" interval="1" script="changingoutfitback.lua"/>

But It seems to not work. I don't get any errors in console ;(

That I want to do is, if the player get a storagevalue and if the player tries to change outfit, it changes back to another outfit.

Thanks
 
why not simply set a creaturescript to cancel the outfit change
LUA:
function onOutfit(cid, old, current)
    if getPlayerStorageValue(cid, 11113) == 1 then
        return 0
    end
    return 1
end
 
CyberM, It don't work ;( I can still change outfit..
I don't get any errors in console.

LUA:
 function onOutfit(cid, old, current)
    if getPlayerStorageValue(cid, 11113) == 1 then
        return 0
    end
    return 1
end

XML:
 	<event type="outfit" name="OutfitChange" script="outfitchange.lua"/>

LUA:
 	registerCreatureEvent(cid, "OutfitChange")
 
Back
Top