Rage Guy Posted May 2, 2013 Posted May 2, 2013 (edited) I Need A Prize npc that got a Privet Prizes for only 1 player and i can send to every one online on the server prizes Edited May 3, 2013 by SpongeBOB Quote
Jaburak Posted May 2, 2013 Posted May 2, 2013 (edited) Try this; prontera,200,180,4 script Prize Sender Test 123,{ if(!getgmlevel())end; set .@itemtoonlineplayers$,strcharinfo(0); mes "Input Item ID"; Input .@item; if (getitemname(.@item) == "null") { mes "Invalid Item ID"; close; } mes "Input Amount"; input .@inum; if( .@inum <= 0 ) { mes "Invalid Amount"; close; } while( .@V < $PlayerNumber ){ set .@V,.@V+1; message getd("$RecordAID"+.@V),"[[[ System ]]] : "+.@itemtoonlineplayers$+" give you "+getitemname(.@item)+"x"+.@inum; getitem .@item,.@inum,getd("$RecordAID"+.@V); } close; } - script PrizeSenderEvent -1,{ OnInit: if(!getusers(1))while($PlayerNumber)setd "$RecordAID"+(set($PlayerNumber, $PlayerNumber-1)+1),0; end; OnPCLoginEvent: setd "$RecordAID"+set(@AIDNumber,set($PlayerNumber,$PlayerNumber+1)),getcharid(3); end; OnPCLogoutEvent: setd "$RecordAID"+@AIDNumber,getd("$RecordAID"+(set(.@AIDNumber,set($PlayerNumber, $PlayerNumber-1)+1))); attachrid getd("$RecordAID"+@AIDNumber); setd "$RecordAID"+@AIDNumber,0; set @AIDNumber,.@AIDNumber; } Edited May 2, 2013 by Anakid Quote
Jaburak Posted May 2, 2013 Posted May 2, 2013 Try Item Rewards by Euphy; http://pastebin.com/raw.php?i=wTG07rbs Quote
Rage Guy Posted May 2, 2013 Author Posted May 2, 2013 i rlly dont understand it o.O input name , pakage number . i dont understand what do he mean ? Quote
Jaburak Posted May 2, 2013 Posted May 2, 2013 Set the prizes first. setarray .Package1[0],501,1,502,2,503,3; setarray .Package2[0],601,5,602,10; setarray .Package3[0],607,10; Talk to the npc then input the player name then select the package. After that; the player need to talk to the NPC to get the reward. Quote
Rage Guy Posted May 2, 2013 Author Posted May 2, 2013 == Am Searching for the NPC That Can Send to every online Player To Only online Players Quote
Euphy Posted May 3, 2013 Posted May 3, 2013 mes "Input an item ID."; input .@item; if (getitemname(.@item) == "null") { mes "Invalid item "+.@item+"."; close; } mes "Input an amount."; input .@amount; if (.@amount == 0 || .@amount > 30000) { mes "Invalid amount "+.@amount+"."; close; } mes " "; mes "Giving "+.@amount+"x "+getitemname(.@item)+" to all players."; close2; set .@size, query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1",.@aid); for(set .@i,0; .@i<.@size; set .@i,.@i+1) { getitem .@item,.@amount,.@aid[.@i]; } end; Quote
Rage Guy Posted May 3, 2013 Author Posted May 3, 2013 prontera,200,180,4 script Prize Sender Test 123,{ if(!getgmlevel())end; set .@itemtoonlineplayers$,strcharinfo(0); mes "Input an item ID."; input .@item; if (getitemname(.@item) == "null") { mes "Invalid item "+.@item+"."; close; } mes "Input an amount."; input .@amount; if (.@amount == 0 || .@amount > 30000) { mes "Invalid amount "+.@amount+"."; close; } mes " "; mes "Giving "+.@amount+"x "+getitemname(.@item)+" to all players."; close2; set .@size, query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1",.@aid); for(set .@i,0; .@i<.@size; set .@i,.@i+1) { getitem .@item,.@amount,.@aid[.@i]; } end; not working with me both didn't work no no its working thannks guys Quote
Euphy Posted May 3, 2013 Posted May 3, 2013 @Anakid: For the record, you really should not use that method of storing names; there's absolutely no reason to use permanent variables for every player (they'll slow down the server by constantly syncing with your `mapreg` table). Performing a single query is far more efficient. Quote
Question
Rage Guy
I Need A Prize npc
that
got a Privet Prizes for only 1 player
and i can send to every one online on the server prizes
Edited by SpongeBOB8 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.