Jump to content
  • 0

Prize Sending


Rage Guy

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

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 SpongeBOB
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

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 by Anakid
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

Try Item Rewards by Euphy; http://pastebin.com/raw.php?i=wTG07rbs

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

i rlly dont understand it o.O



input name , pakage number . i dont understand what do he mean ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

==

Am Searching for the NPC That Can Send to every online Player



To Only online Players

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

	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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

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 ^_^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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

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