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

[Talckaction] Need script for REMOVE second promotion.

delton

New Member
Joined
Jun 13, 2008
Messages
230
Reaction score
0
Location
Ijuí
Hail otlanders

I need help with talckaction that do remove second promotion.

Example: I will kick all players and send comand !remove vip [player name].

And he/she back for first vocation.

Example: If he is Epic Knight.. he back to Knight..

Thanks ALL

Srry spam and bad english ;)
 
Creat file with name promotion.lua

PHP:
function onSay(cid,words,param)

local requiredGroup = 1

local promotionStorageValue = (Put here storge of the Promotion)

local target = getPlayerByNameWildcard(param)

	if words == '/addpromotion' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, promotionStorageValue) == -1 then 
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, PromotionStorageValue, 1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now Promoted') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made a Promoted to "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't make Promotion to anyone.")
			
		elseif getPlayerStorageValue(target, PromotionStorageValue) ~= -1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already promoted")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
		

	elseif words == '/removepromotion' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, promotionStorageValue) == 1 then
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, promotionStorageValue, -1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now Not Promoted player.') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You took the Promotion of "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't take the Promotion of anyone.")
			
		elseif getPlayerStorageValue(target, promotionStorageValue) ~= 1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a Promoted member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
end		
return TRUE
end

Then put this in talkactions.xml

PHP:
	<talkaction log="yes" words="/addpromotion" event="script" value="promotion.lua"/>
	<talkaction log="yes" words="/removepromotion" event="script" value="promotion.lua"/>

Remember to give me rep++ :D
 
Creat file with name promotion.lua

PHP:
function onSay(cid,words,param)

local requiredGroup = 1

local promotionStorageValue = (Put here storge of the Promotion)

local target = getPlayerByNameWildcard(param)

	if words == '/addpromotion' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, promotionStorageValue) == -1 then 
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, PromotionStorageValue, 1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now Promoted') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made a Promoted to "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't make Promotion to anyone.")
			
		elseif getPlayerStorageValue(target, PromotionStorageValue) ~= -1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already promoted")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
		

	elseif words == '/removepromotion' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, promotionStorageValue) == 1 then
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, promotionStorageValue, -1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now Not Promoted player.') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You took the Promotion of "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't take the Promotion of anyone.")
			
		elseif getPlayerStorageValue(target, promotionStorageValue) ~= 1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a Promoted member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
end		
return TRUE
end

Then put this in talkactions.xml

PHP:
	<talkaction log="yes" words="/addpromotion" event="script" value="promotion.lua"/>
	<talkaction log="yes" words="/removepromotion" event="script" value="promotion.lua"/>

Remember to give me rep++ :D

I believe that would only work if he promoted people in the first place this way..
 
Back
Top