Jump to content
  • 0

@item restriction


Question

Posted

Good day rA!

 

Requesting for this script.

 

A script that restricts specific item when using @item.

 

Case:

Example:

Restricted @item : 607, 7227, Apple, etc.

Only GM with this level = prefer GM 99 can override the restricted item.

GM Below 99 cannot @item the said restricted item. 

Thanks! :D

11 answers to this question

Recommended Posts

Posted

It may be an issue. Replace the 2 OnAtCommand by OnAtcommand

Also replace

if( getitemname( .@itemid ) != "" && .@quantity ){

by

if( getitemname( .@itemid ) != "null" && .@quantity ){

getitemname return "null" for an non-existent item

 

EDIT wth I post after your report and my post is above your xD

Posted (edited)

I tried this script, I can't @item any item haha. I removed the script, and the effect is still there haha now I can't @item anything

 

 

fixed my problem with:

 

-    script    unbinditem    -1,{
OnInit:
unbindatcmd "item";
}

 

 

 

I REALLY do hope that there's a working script that works like this :/

Edited by orochimakoto
Posted


- script atcmd_example -1,{

OnInit:

bindatcmd "item",strnpcinfo(3)+"::OnAtcommand";

setarray .item_restrict,

607,

7227;

.item_restrict_size = getarraysize( .item_restrict );

end;

OnAtcommand:

.@gmlevel = getgmlevel();

if( .@gmlevel && .@atcmd_numparameters ){

.@itemid = atoi( .@atcmd_parameters$[0] );

if( .@gmlevel < 99 ){

for( .@i = 0; .@i < .item_restrict_size; .@i++ )

if( .@itemid == .item_restrict[.@i] ){

message strcharinfo(0),"Cant create this items.";

end;

}

}

if( getitemname( .@itemid ) != "null" ){

.@quantity = atoi( .@atcmd_parameters$[1] );

if ( .@quantity < 1 ) .@quantity = 1;

getitem .@itemid,.@quantity;

}

}

end;

}

Posted
-	script	atcmd_example	-1,{
OnInit:
	bindatcmd "item",strnpcinfo(3)+"::OnAtcommand";
	setarray .item_restrict,
		607,
		7227;
	.item_restrict_size = getarraysize( .item_restrict );
	end;
OnAtcommand:
	.@gmlevel = getgmlevel();
	if( .@gmlevel && .@atcmd_numparameters ){
		.@itemid = atoi( .@atcmd_parameters$[0] );
		if( .@gmlevel < 99 ){
			for( .@i = 0; .@i < .item_restrict_size; .@i++ )
				if( .@itemid == .item_restrict[.@i] ){
					message strcharinfo(0),"Cant create this items.";
					end;
				}
		}
		if( getitemname( .@itemid ) != "null" ){
			.@quantity = atoi( .@atcmd_parameters$[1] );
			if ( .@quantity < 1 ) .@quantity = 1;
			getitem .@itemid,.@quantity;
		}
	}
	end;

}

still not able to use @item even with GM LVL 99 , using latest SVN

bump

bump

buuuuuuump need help

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