Check item

Yoh Asakura

New member
Messages
261
Points
0
Emulator
Hi,

I'm trying to block an item in a map but some players just put this item in the cart and they can enter in the map, take the item from the cart and use.

Well, if I add a script that checks each second if the player has this item, the script would detect who has the item and teleport them to prontera.

I tried to do it based on the AFK script.

- script checkitem -1,{
 
 
OnInit:
    .timetocheck = 1;        //Seconds after which idle is checked.
end;
 
 
OnPCLoadMapEvent::
    addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";
    end;
                                                               
OnCheckAFK:
if(countitem(607) > 0 || countitem(608) > 0) { 
mes "[^FF0000 Guard ^000000]"; 
mes "Sorry this item is not allowed in here!,"; 
close2; 
warp "prontera",150,150; 
}
end;
}
    addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckAFK";
}
 
// Mapflag
pvp_n_6-5 mapflag loadevent
 



Anyone could help me?

Other topic: http://herc.ws/board/topic/9089-map-zone-db/

 
Last edited by a moderator:
dude just stick with the map zone thing, they will be able to bring it, (even use it depending on your settings) but it won't have any effect

 
try this if you want to..

Code:
-	script	checkitem	-1,{	end;OnPCLoadMapEvent:	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckItem";	end;OnCheckItem:	for (.@i = 0; .@i < getarraysize(.item_list); .@i++) {		if (countitem(.item_list[.@i])) {			mes "[^FF0000 Guard ^000000]"; 			mes "Sorry "+getitemname(.item_list[.@i])+" is not allowed in here!,"; 			close2; 			warp "prontera",150,150;			end;		}	}	addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckItem";	end;OnInit:	setarray .item_list, 607, 608;	// add item you want to check here	.timetocheck = 1;	//Seconds after which idle is checked.	end;}// Mapflagpvp_n_6-5	mapflag	loadevent
 
Last edited by a moderator:
Code:
OnPCLoadMapEvent:    if (strcharinfo(3) == "pvp_n_6-5") {        addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckItem";    }    end;OnCheckItem:    for (.@i = 0; .@i < getarraysize(.item_list); .@i++) {        if (countitem(.item_list[.@i]) && strcharinfo(3) == "pvp_n_6-5") {            mes "[^FF0000 Guard ^000000]";            mes "Sorry "+getitemname(.item_list[.@i])+" is not allowed in here!,";            close2;            warp "prontera",150,150;            end;        }    }    if (strcharinfo(3) == "pvp_n_6-5") {        addtimer .timetocheck*1000,strnpcinfo(3)+"::OnCheckItem";    }    end;
 
Last edited by a moderator:
Yow can you do this in Skill check? for prohibited skill like hiding cloacking and invinsibility? please make if possible
default_happy.png


 
Back
Top