Jump to content
  • 0

Question

2 answers to this question

Recommended Posts

  • 0
Posted

Hi! Here's what I use, you wont need any source edits for this one:

-	script	itemmap	-1,{
OnInit:
    bindatcmd "itemmap",strnpcinfo(3)+"::OnAtcommand",99,99;
    end;
OnAtcommand:
		if ( .@atcmd_numparameters != 2 ) {
			message .@myname$, "Usage: "+ .@atcmd_command$ +" <item id> <amount>";
			end;
		}
		.atoi_id = atoi( .@atcmd_parameters$[0] );
		.atoi_amount = atoi( .@atcmd_parameters$[1] );
		.@myname$ = strcharinfo(0);
		if ( getiteminfo( .atoi_id,0 ) == -1 ) {
			message .@myname$, "Requesting to send an non-existing item ("+ .atoi_id +"). "+ .@atcmd_command$ +" failed.";
			end;
		}
		else if ( .atoi_amount < 1 ) {
			message .@myname$, "You can't send "+ .atoi_amount +" item. "+ .@atcmd_command$ +" failed.";
			end;
		}
		addrid(1);
		if(checkvending(strcharinfo(0))) { end; }
		else { getitem .atoi_id, .atoi_amount; }
		end;
}

 

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...