Jump to content

Question

Posted

hi im using this script on my eamod and i got error see attachment below

 

//===== eAthena Script =======================================================
//= Main Chat system
//===== By: ==================================================================
//= StaR-o
//===== Current Version: =====================================================
//= 1.0
//===== Compatible With: =====================================================
//= any rathena version
//===== Description: =========================================================
//= Adding a new @main channel without source edit and without ugly @main command
//===== Additional Comments: =================================================
//= Still not final version, but ready to use
//============================================================================

-	script	main	-1,{
	OnWhisperGlobal:
		if(callfunc("checkPermission","2,3,4,5,6,7,8,10,11,99")) {
			if(substr(@whispervar0$,0,3) == ".ban") {
				sscanf(@whispervar0$,".ban %s",.@banname$);
				set .@banid, getcharid(3,.@banname$);
				set .@origid, getcharid(3);
				if(attachrid(.@banid) && isloggedin(.@banid) && .@banname$ != "") {
					set ##mainban,1;
					message strcharinfo(0),"[#Main]: You have been banned from main chat.";
					attachrid .@origid;
					message strcharinfo(0),"[#Main]: "+.@banname$+" has been banned from main chat.";
				} else {
					attachrid .@origid;
					message strcharinfo(0),"[#Main]: "+.@banname$+" is offline or does not exist.";
				}
				end;
			} else if(substr(@whispervar0$,0,5) == ".unban") {
				sscanf(@whispervar0$,".unban %s",.@banname$);
				set .@banid, getcharid(3,.@banname$);
				set .@origid, getcharid(3);
				if(attachrid(.@banid) && isloggedin(.@banid) && .@banname$ != "") {
					set ##mainban,0;
					message strcharinfo(0),"[#Main]: You have been unbanned from main chat.";
					attachrid .@origid;
					message strcharinfo(0),"[#Main]: "+.@banname$+" has been unbanned from main chat.";
				} else {
					attachrid .@origid;
					message strcharinfo(0),"[#Main]: "+.@banname$+" is offline or does not exist.";
				}
				end;
			}
		}
		
		if(@whispervar0$ == "on") {
			atcommand "@main "+@whispervar0$;
			set mainchat,1;
			end;
		} else if(@whispervar0$ == "off") {
			atcommand "@main "+@whispervar0$;
			set mainchat,0;
			end;
		}
		
		if(##mainban == 1) {
			message strcharinfo(0),"[#Main]: You are currently banned from main chat.";
		} else {
			atcommand "@main "+@whispervar0$ + @whispervar1$ + @whispervar2$;
		}
		end;
		
		OnPCLoginEvent:
			if(mainchat == 1) atcommand "@main on";
			sleep2 1000;
			message strcharinfo(0),"[#Main]: Participate in main chat by messaging npc:main. Send on/off to enable/disable system.";
			end;
}

//Check user group against provided argument to determine if player is authorized or not.
//Second arg set to 1 for verbose authorization denied, no second arg for simple check

function	script	checkPermission	{
	explode(.@authed$,getarg(0),",");
	for(set .@i,0; .@i < getarraysize(.@authed$); set .@i,.@i +1) {
		set .@authed$[.@i],"_"+.@authed$[.@i]+"_";
	}
	set .@authed$,implode(.@authed$,",");
	if(compare(.@authed$,"_"+getgroupid()+"_")) {
		return 1;
	} else if(getarg(1,0) == 1) {
		mes "[Access Denied]";
		mes "You must belong to one of the following groups:";
		mes callfunc("returnUserGroup",getarg(0));
		mes " ";
		mes "You belong to: "+ callfunc("returnUserGroup",getgroupid());
		close;
	} else {
		return 0;
	}
}


more info..

 

i got this when im trying to contact the npc

 


[Error]: script:callfunc: function not found! [checkPermission]
[Debug]: Source (NPC): main (invisible/not on a map)

post-3084-0-09552800-1372537776_thumb.jpg

4 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...