Jump to content
  • 0

@itemfloor command?


Question

9 answers to this question

Recommended Posts

Posted


- script item_floor -1,{

OnInit:

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

end;

OnAtcommand:

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

.@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1;

if ( getiteminfo( .@item_id,0 ) == -1 ) {

message strcharinfo(0), "non existent item id";

message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}";

end;

}

getmapxy .@map$, .@x, .@y, 0;

makeitem .@item_id, .@amount, .@map$, .@x, .@y;

end;

}

Posted
-	script	item_floor	-1,{
OnInit:
	bindatcmd "itemfloor",strnpcinfo(3)+"::OnAtcommand";
	end;
OnAtcommand:
	.@item_id = atoi(.@atcmd_parameters$[0]);
	.@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1;
	if ( getiteminfo( .@item_id,0 ) == -1 ) {
		message strcharinfo(0), "non existent item id";
		message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}";
		end;
	}
	getmapxy .@map$, .@x, .@y, 0;
	makeitem .@item_id, .@amount, .@map$, .@x, .@y;
	end;
}

 

thank but is it possible that only admin can use this command? or its already added it the script?

Posted

 

Alright thanks! capuche!

 

 

Alright thanks! capuche!

 

 

Its working fine but , how can we make it only 1pc of Gold will drop on the floor but 1000pcs on the map?

Posted


- script item_floor -1,{

OnInit:

bindatcmd "itemfloor",strnpcinfo(3)+"::OnAtcommand",99,99;

end;

OnAtcommand:

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

.@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1;

if ( getiteminfo( .@item_id,0 ) == -1 ) {

message strcharinfo(0), "non existent item id";

message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}";

end;

}

getmapxy .@map$, .@x, .@y, 0;

while ( .@i < .@amount ) {

do {

.@dx = rand( -200, 200 );

.@dy = rand( -200, 200 );

} while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );

makeitem .@itemid, 1, .@map$, (.@x + .@dx), (.@y + .@dy);

.@i++;

}

end;

}

Posted
-	script	item_floor	-1,{
OnInit:
	bindatcmd "itemfloor",strnpcinfo(3)+"::OnAtcommand",99,99;
	end;
OnAtcommand:
	.@item_id = atoi(.@atcmd_parameters$[0]);
	.@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1;
	if ( getiteminfo( .@item_id,0 ) == -1 ) {
		message strcharinfo(0), "non existent item id";
		message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}";
		end;
	}
	getmapxy .@map$, .@x, .@y, 0;
	while ( .@i < .@amount ) {
		do {
			.@dx = rand( -200, 200 );
			.@dy = rand( -200, 200 );
		} while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );
		makeitem .@itemid, 1, .@map$, (.@x + .@dx), (.@y + .@dy);
		.@i++;
	}
	end;
}

 

Thank you for the response but it's not working.. no errors at all

Posted
-	script	item_floor	-1,{
OnInit:
	bindatcmd "itemfloor",strnpcinfo(3)+"::OnAtcommand",99,99;
	end;
OnAtcommand:
	.@item_id = atoi(.@atcmd_parameters$[0]);
	.@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1;
	if ( getiteminfo( .@item_id,0 ) == -1 ) {
		message strcharinfo(0), "non existent item id";
		message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}";
		end;
	}
	getmapxy .@map$, .@x, .@y, 0;
	freeloop 1;
	while ( .@i < .@amount ) {
		do {
			.@dx = rand( -200, 200 );
			.@dy = rand( -200, 200 );
		} while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );
		makeitem .@item_id, 1, .@map$, (.@x + .@dx), (.@y + .@dy);
		.@i++;
	}
	end;
}

.@item_id typo error

  • Upvote 1
  • Love 1

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