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

GM Command Change Speed

rigatto

New Member
Joined
Sep 1, 2008
Messages
4
Reaction score
0
Hello!

I would like to know if it's possible to create a command for Gamemasters so they can change their walking speed, just like global.

It's a TalkAction script, and I would like that Gamemasters have 4 different speeds: slow, normal, fast and faster...

And if possible, the Spell could be: alani hur

For example:

alani hur "slow
alani hur "normal
etc...


Thankyou so much! =)
 
LUA:
function onSay(cid, words, param, channel)

	local current_speed = getCreatureSpeed(cid)
	local new_speed = current_speed
        
	if param == 'slow' then
		new_speed = 100
	elseif param == 'normal' then
		new_speed = 400
	elseif param == 'fast' then
		new_speed = 700
	elseif param == 'fastest' then
		new_speed = 1500
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your parameter must be either: slow, normal, fast or fastest.")
	end
	
	if current_speed < new_speed then
		doChangeSpeed(cid, new_speed - current_speed)
	elseif current_speed > new_speed then
			doChangeSpeed(cid, new_speed - current_speed)
	end
	
return true
end

There are probably a hundred ways this script could be optimized, but it works for now, lol.
 
Last edited by a moderator:
LUA:
function onSay(cid, words, param, channel)

	local current_speed = getCreatureSpeed(cid)
	local new_speed = current_speed
        
	if param == 'slow' then
		new_speed = 100
	elseif param == 'normal' then
		new_speed = 400
	elseif param == 'fast' then
		new_speed = 700
	elseif param == 'fastest' then
		new_speed = 1500
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your parameter must be either: slow, normal, fast or fastest.")
	end
	
	if current_speed < new_speed then
		doChangeSpeed(cid, new_speed - current_speed)
	elseif current_speed > new_speed then
			doChangeSpeed(cid, new_speed - current_speed)
	end
	
return true
end

There are probably a hundred ways this script could be optimized, but it works for now, lol.

Thankyou so much Icy! It worked perfect!!! =)
 
Back
Top