Budots Posted December 3, 2013 Posted December 3, 2013 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 Quote
Patskie Posted December 3, 2013 Posted December 3, 2013 *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; 2 Quote
Patskie Posted December 3, 2013 Posted December 3, 2013 Try : http://pastebin.com/raw.php?i=QfcKMru3 Quote
Talaysen Posted December 31, 2013 Posted December 31, 2013 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. Quote
Patskie Posted December 31, 2013 Posted December 31, 2013 I have change the link of my previous post. Quote
AnnieRuru Posted December 31, 2013 Posted December 31, 2013 (edited) 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 npcthat 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 December 31, 2013 by AnnieRuru Quote
Patskie Posted December 31, 2013 Posted December 31, 2013 Problem with me is that i always make a script and never test it that is why even small bugs/error slip unto me. Quote
Question
Budots
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
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.