Jump to content
  • 0

How to add custom @cmd for information?


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

Hi,

Player got exp from success like example, mining success.. Each success, player will get 1 exp.

 

But I want to make player can check how many mining exp by using @mining. I tried the scripts below but when I use that @mining, nothing happened.. And check at map.exe got npc_event : event not found.. Which do I miss? Or how to make this works? Thank you..

OnPCLoginEvent:
	set @MineExpTotal,@MineExp;
        end;
	
OnCmdMining:
	dispbottom strcharinfo(0),"your mining EXP is "+(MineExp)+".";
	end;
	
OnInit:
        bindatcmd "mining","Milenia Mining Corp::OnCmdMining";
        end;
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

make sure your npc name are

Milenia Mining Corp
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

 

make sure your npc name are

Milenia Mining Corp

 

My NPC name : 

milenia,40,147,3	script	Milenia Mining Corp	726,{
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

 

Hi,

Player got exp from success like example, mining success.. Each success, player will get 1 exp.

 

But I want to make player can check how many mining exp by using @mining. I tried the scripts below but when I use that @mining, nothing happened.. And check at map.exe got npc_event : event not found.. Which do I miss? Or how to make this works? Thank you..

OnPCLoginEvent:
	set @MineExpTotal,@MineExp;
        end;
	
OnCmdMining:
	dispbottom strcharinfo(0),"your mining EXP is "+(MineExp)+".";
	end;
	
OnInit:
        bindatcmd "mining","Milenia Mining Corp::OnCmdMining";
        end;

 

try to repalce

bindatcmd "mining","Milenia Mining Corp::OnCmdMining";

to

bindatcmd strnpcinfo(3) +"::OnCmdMining", 0, 99;

where 0, 99 = means all palyers can use this command.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

Not working.. I get : 

Unexpected type for argument 2. Expected string. and cant event using @mining command.. 

But when using script i post before, I can use @mining command.. But the server side shows [Error] npc_event : npc_event not found [mining::OnCmdMining]

Already change the name pc name to mining only.. Also not found.. Maybe i make mistake with this OnPCLoginEvent? 
 

OnPCLoginEvent:
	set @MineExpTotal,@MineExp;
        end;

EDIT :

Just figure it out.. I put the script at wrong section.. So it not load the NPC name but load that other NPC name.. Which is the cause it not functioning.. Thank you guys..

Edited by rakuzas
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...