Jump to content
  • 0

Give Item Script


Budots

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  200
  • Reputation:   1
  • Joined:  09/25/13
  • Last Seen:  

Can i request for a script that will give item on ALL PLAYERS IN THE MAP and also ALL PLAYERS IN THE SERVER?

Is it possible?

Thanks in advance

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  


*addrid(<type>{,<flag>{,<parameters>}});

This command will attach other RIDs to the current script without detaching the

invoking RID. It returns 1 if successful and 0 upon failure.

<type> determines what RIDs are attached:

0: All players in the server.

1: All players in the map of the invoking player, or the invoking NPC if no player is attached.

2: Party members of a specified party ID.

[ Parameters: <party id> ]

3: Guild members of a specified guild ID.

[ Parameters: <guild id> ]

4: All players in a specified area of the map of the invoking player (or NPC).

[ Parameters: <x0>,<y0>,<x1>,<y1> ]

Account ID: The specified account ID.

<flag> can prevent certain players from being attached:

0: Players are always attached. (default)

1: Players currently running another script will not be attached.


// map of invoking character or npc

addrid(1);

getitem 7227,5;


// whole server

addrid(0); 

getitem 7227,5;

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  200
  • Reputation:   1
  • Joined:  09/25/13
  • Last Seen:  

sir pat can you make one for me?  /thx

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

It doesn't do anything.

When I click the NPC, it asks me to enter an item ID, but doesn't give me a field to enter it in.

I get this error:

[Warning]: Unexpected type for argument 1. Expected string.

[Debug]: Data: variable name='.@id' index=0

[Debug]: Function: mes

[Debug]: Source (NPC): Etienne at prontera (150,150)

[Error]: buildin_getitem: Nonexistant item 0 requested.

[Debug]: Source (NPC): Etienne at prontera (150,150)

Note: I renamed the NPC to Etienne.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

I have change the link of my previous post.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I tried the script

I input 1

[Error]: buildin_getitem: Nonexistant item 1 requested.
[Debug]: Source (NPC): Sample at prontera (150,150)
getitemname return "null" when it item ID wasn't found

BUILDIN_FUNC(getitemname)
.....
	if (i_data == NULL)
	{
		script_pushconststr(st,"null");
		return 0;
	}
also

[Debug]: Source (NPC): Sample at prontera (150,150)
[Warning]: Incorrect use of 'close' command! (source:Sample / path:@ßX)
when attaching an ID that wasn't talking to an npc

that ID should've use end; instead of close ...

also,

the .@id is a scope variable

using addrid attach the rid on other players, has to use .id <-- npc variable

I think I do ... wait I edit

ok

prontera,150,150,0	script	Sample	123,{
	if ( getgmlevel() < 99 ) end;
	mes "Input item id";
	next;
	input .itemid;
	if ( getitemname( .itemid ) == "null" ) {
		mes "non-existant id";
		close;
	}
	.@origin = getcharid(3);
	addrid 0; // 0 or 1
	getitem .itemid, 1;
	if ( .@origin == getcharid(3) )
		close;
	else
		end;
}

@Patskie

I remember I kept saying this before last year ...

scripting section is not a place that you throw them with script_commands.txt and expect them to write out themselves

sometimes there are unseen bug that only experienced scripters can point it out

and even if they are able to produce a properly working script, without guidance, their script will be unoptimized one

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Problem with me is that i always make a script and never test it that is why even small bugs/error slip unto me. :P 

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