Jump to content
  • 0
hannicaldummy

Attached player to script when use

Question

Hello, i`m trying to make a find gm event with command, but mapserver r getting this error

[Error]: buildin_getcharid: fatal error ! player not attached!
[Debug]: Function: getcharid (1 parameter):
[Debug]: Data: number value=0
[Debug]: Source (NPC): FindEvt_Script (invisible/not on a map)

Here script, anyone knows why?

-	script	FindEvt_Script	-1,{

OnInit:
		bindatcmd("achaevt","achaevt::OnAtcommand",50,50);
    end;

OnFindEvt:
	atcommand "@achaevt";

OnAtcommand:
	announce "[Ache o Evento] Nós vamos começar um novo evento!",0;
	sleep 10000;
	announce "[Ache o Evento] O(a) Evento irá se esconder em uma cidade do jogo",0;
	sleep 10000;
	announce "[Ache o Evento] O primeiro que descobrir onde é e achá-lo(a) vence!",0;
	initnpctimer;
	end;

OnTimer10000:
    	switch(rand(2))
	{
	case 0:
		announce "[Ache o Evento] brasilis!",0;
		callsub	Process,"brasilis",0,0,0,0;
		end;
	case 1:
		announce "[Ache o Evento] prontera!",0;
		callsub	Process,"prontera",0,0,0,0;
		end;
	case 2:
		announce "[Ache o Evento] geffen!",0;
		callsub	Process,"geffen",0,0,0,0;
		end;
	}

Process:
	set @charid$,getcharid(0);
	set @mapname$,getarg(0);
	set @x,getarg(1);
	set @y,getarg(2);		
	warp @charid$,@mapname$,@x,@y;
	end;

}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
-	script	FindEvt_Script	-1,{

OnInit:
	bindatcmd("achaevt","achaevt::OnAtcommand",50,50);
    end;

OnAtcommand:
    switch(rand(3)) {
		case 0:
			callsub	Process,"brasilis",0,0;
			break;
		case 1:
			callsub	Process,"prontera",0,0;
			break;
		case 2:
			callsub	Process,"geffen",0,0;
			break;
	}
	end;

Process:
	[email protected] = getcharid(0);
	[email protected]$ = getarg(0);
	[email protected] = getarg(1, 0);
	[email protected] = getarg(2, 0);
	
	announce "[Ache o Evento] Nós vamos começar um novo evento!",0;
	sleep2 10000;
	announce "[Ache o Evento] O(a) Evento irá se esconder em uma cidade do jogo",0;
	sleep2 10000;
	announce "[Ache o Evento] O primeiro que descobrir onde é e achá-lo(a) vence!",0;
	sleep2 10000;
	announce "[Ache o Evento] "[email protected]$+"!",0;
	warp [email protected]$,[email protected],[email protected], [email protected];
	end;

}

you can try something like this.

  • Upvote 1
Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.