Jump to content
  • 0

•✖ » Prize NPC « ✖•


Rage Guy

Question


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

How to make this npc when he send item go to player storage cuz if he have max waight its droped from him

 

Sorry for my bad english

ayo_in02,108,161,4    script    Prize Sender    437,{
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;

}
 

 

 

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:  

I think this is not possible. But there's other way to prevent the item from dropping if they're overweight.

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:  

How ?

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:  


ayo_in02,108,161,4 script Prize Sender 437,{

if(!getgmlevel())end;

if( Weight > ( MaxWeight / 2 ) ){

mes "You are Overweight!";

close;

}

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;

}

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:  

what will happend if some one got over waight?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  117
  • Reputation:   8
  • Joined:  05/07/12
  • Last Seen:  

if( Weight > ( MaxWeight / 2 ) ){

    mes "You are Overweight!";

close;

 

this, it wont give out the item.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

if( Weight > ( MaxWeight / 2 ) ){
	mes "You are Overweight!";
	close;
}
This is wrong. In this part server will check GM's weight, not player.

Need to attach to each player for check weight like:

while( .@V < $PlayerNumber ){
	set .@V,.@V+1;
	message getd("$RecordAID"+.@V),"[[[ System ]]] : "+.@itemtoonlineplayers" give you "+getitemname(.@item)+"x"+.@inum;
	attachrid(getd("$RecordAID"+.@V));
	if(checkweight(.@item,.@inum))
		getitem .@item,.@inum,getd("$RecordAID"+.@V);
	else
		message getd("$RecordAID"+.@V),"You are Overweight!";
}
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:  

But it works fine in my test server. :) Docubo only answers SpongeBOB question.

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:  

Thanks All ALOT /lv



Where to put

while( .@V < $PlayerNumber ){
	set .@V,.@V+1;
	message getd("$RecordAID"+.@V),"[[[ System ]]] : "+.@itemtoonlineplayers" give you "+getitemname(.@item)+"x"+.@inum;
	attachrid(getd("$RecordAID"+.@V));
	if(checkweight(.@item,.@inum))
		getitem .@item,.@inum,getd("$RecordAID"+.@V);
	else
		message getd("$RecordAID"+.@V),"You are Overweight!";
}

inside the script

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