Please help me with this script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Please help me with this script

Started by DorianG, 29 February, 2004, 15:06:56

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DorianG

I want to make a nick ban command, but I would want that an operator that uses this command, don't can ban users that are a part of these profile: 5, 6 and 0..
I have writen this code but don't work well..
If anybody helps me he would do me a favor :)


function Boom(user, data)
	s,e,cmd,str,msg = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)")
	local usr = GetItemByName(str)
	if usr.iProfile == "5" or usr.iProfile == "6" or usr.iProfile == "0" then
		user:SendPM(Bot, "You are not allowd to kick  "..str)
	else
		local usr = GetItemByName(str)
		SendPmToNick(str, Bot, "You are being kicked by "..user.sName.." because:  " ..msg)
		usr:NickBan()
		SendToOps(Bot, "The user   "..str.." is kicking by  "..user.sName.." because:  " ..msg)
	end
end

NightLitch

maybe this works:

function Boom(user, data)
	s,e,str,msg = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(.*)")
	local usr = GetItemByName(str)
	if usr.iProfile == "5" or usr.iProfile == "6" or usr.iProfile == "0" then
		user:SendPM(Bot, "You are not allowd to kick  "..usr.sName)
	else
		SendPmToNick(usr.sName, Bot, "You are being kicked by "..user.sName.." because:  " ..msg)
		SendToOps(Bot, "The user   "..usr.sName.." is kicking by  "..user.sName.." because:  " ..msg)
		usr:NickBan()
	end
end

/NL
//NL

DorianG

#2
I have tried but the problem is always the usual. If I enter like user of 5 level and I ban a user of 6 level, the bot doesn't stop me but ban he..
Idem if i enter with an other level user..

My users profile..

0|Master|10001111110111111100111000000001
1|Operator|10000100010001111100110000000001
2|VIP|10000000000001111000000000000000
3|Reg|10000000000000000000000000000000
4|Mod|10000110110111111100111000000001
5|Admin|10001111110111111100111000000001
6|Owner|10001111110111111100111000000001

NightLitch

did understand you english to well but trie this then:

function Boom(user, data)
	s,e,str,msg = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(.*)")
	local usr = GetItemByName(str)
	if usr.iProfile == 5 or usr.iProfile == 6 or usr.iProfile == 0 then
		user:SendPM(Bot, "You are not allowd to kick  "..usr.sName)
	else
		SendPmToNick(usr.sName, Bot, "You are being kicked by "..user.sName.." because:  " ..msg)
		SendToOps(Bot, "The user   "..usr.sName.." is kicking by  "..user.sName.." because:  " ..msg)
		usr:NickBan()
	end
end

the problem was this:

you had:

if usr.iProfile == "5" or usr.iProfile == "6" or usr.iProfile == "0" then

this is how it should look like:

if usr.iProfile == 5 or usr.iProfile == 6 or usr.iProfile == 0 then
//NL

DorianG

oh yes :) good work and thank you very much :)

SMF spam blocked by CleanTalk