Jump to content
  • 0

Close button won't pop up..


Question

Posted (edited)
new_1-1,179,80,5    script    GM Prize    757,{
if (strcharinfo(0)=="strcharinfo(0)=="[Admin] Dreamworks"){
mes "Enter Items ID (Don't matter. Put 512 for example) :";
mes "It will be Event Coins anyways.";
mes " 0 = Cancel";
do{
  input .@ItemID;
  if( .@ItemID < 1 ) close;
}while( getitemname( .@ItemID ) == "null" );
mes "Enter Amount (Max is 500 Event Coins) :";
input .@Amount,1,500;
mes "Enter Name :";
input .@Name$;
next;
mes "Name : "+.@Name$;
mes "Item : "+getitemname( .@ItemID );
mes "Amount : "+.@Amount;
if( select("Confirm:Cancel") == 1 ){
  if( !attachrid( getcharid(3,.@Name$) ) )
   message strcharinfo(0),"Player not Found.";
  else{
   getitem 12619,.@Amount,getcharid(3,.@Name$);
   message strcharinfo(0),"Item Sent";
    message .@Name$,"You Received Event Coins Player "+strcharinfo(0);
    announce "Event Reward: Player " + strcharinfo(0) + "! received his Event Coins as Event Prize!",bc_all;
   close;
  }
}
}
close;
}

 

 

 

Edited by Emistry
Changed to [Code].

9 answers to this question

Recommended Posts

Posted
new_1-1,179,80,5 script GM Prize 757,{
if (strcharinfo(0)=="[Admin] Dreamworks") {
    mes "Enter Items ID (Don't matter. Put 512 for example) :";
    mes "It will be Event Coins anyways.";
    mes " 0 = Cancel";
do {
    input .@ItemID;
    if( .@ItemID < 1 ) close;
} while (getitemname (.@ItemID) == "null");
mes "Enter Amount (Max is 500 Event Coins) :";
input .@Amount,1,500;
next;
mes "Enter Name :";
tryagain:
input .@Name$;
if (!attachrid(getcharid(3,.@Name$))) {
message strcharinfo(0),"Player not found!";
goto tryagain;
}
next;
mes "Name : "+.@Name$;
mes "Item : "+getitemname(.@ItemID);
mes "Amount : "+.@Amount;
if (select("Confirm:Cancel") == 1) {
    getitem .@ItemID,.@Amount,getcharid(3,.@Name$);
    message strcharinfo(0),"Item sent.";
    message .@Name$,"You received "+.@Amount+" "+getitemname(.@ItemID)+" from "+strcharinfo(0);
announce "Event Reward: Player "+.@Name$+" received "+.@Amount+" "+getitemname(.@ItemID)+" as Event Prize!",bc_all;
    }
close;
}
mes "Sorry, I only talk to GM"; close;
}
Posted (edited)
new_1-1,179,80,5 script GM Prize 757,{
if (strcharinfo(0)=="[Admin] Dreamworks") {
    mes "Enter Items ID (Don't matter. Put 512 for example) :";
    mes "It will be Event Coins anyways.";
    mes " 0 = Cancel";
do {
    input .@ItemID;
    if( .@ItemID < 1 ) close;
} while (getitemname (.@ItemID) == "null");
mes "Enter Amount (Max is 500 Event Coins) :";
input .@Amount,1,500;
next;
mes "Enter Name :";
tryagain:
input .@Name$;
if (!attachrid(getcharid(3,.@Name$))) {
message strcharinfo(0),"Player not found!";
goto tryagain;
}
next;
mes "Name : "+.@Name$;
mes "Item : "+getitemname(.@ItemID);
mes "Amount : "+.@Amount;
if (select("Confirm:Cancel") == 1) {
    getitem .@ItemID,.@Amount,getcharid(3,.@Name$);
    message strcharinfo(0),"Item sent.";
    message .@Name$,"You received "+.@Amount+" "+getitemname(.@ItemID)+" from "+strcharinfo(0);
announce "Event Reward: Player "+.@Name$+" received "+.@Amount+" "+getitemname(.@ItemID)+" as Event Prize!",bc_all;
    }
close;
}
mes "Sorry, I only talk to GM"; close;
}

 

 

 

After Enter Name, it hangs lol

Edited by Emistry
Changed to [Code].
Posted

No error message?



new_1-1,179,80,5    script    GM Prize    757,{
if (strcharinfo(0)=="[Admin] Dreamworks") {
mes "Enter Items ID (Don't matter. Put 512 for example) :";
mes "It will be Event Coins anyways.";
mes " 0 = Cancel";
do {
input .@ItemID;
if( .@ItemID < 1 ) close;
} while (getitemname (.@ItemID) == "null");
mes "Enter Amount (Max is 500 Event Coins) :";
input .@Amount,1,500;
next;
mes "Enter Name :";
tryagain:
input .@Name$;
if(getmapxy(@map$,@x,@y,0,.@Name$)!=0) {
message strcharinfo(0),"Player "+.@Name$+" is not found!";
goto tryagain;
}
next;
mes "Name : "+.@Name$;
mes "Item : "+getitemname(.@ItemID);
mes "Amount : "+.@Amount;
if (select("Confirm:Cancel") == 1) {
getitem .@ItemID,.@Amount,getcharid(3,.@Name$);
message strcharinfo(0),"Item sent.";
message .@Name$,"You received "+.@Amount+" "+getitemname(.@ItemID)+" from "+strcharinfo(0);
announce "Event Reward: Player "+.@Name$+" received "+.@Amount+" "+getitemname(.@ItemID)+" as Event Prize!",bc_all;
}
close;
}
mes "Sorry, I only talk to GM"; close;
}

/?

Posted
new_1-1,179,80,5 script GM Prize 757,{

if (strcharinfo(0)=="[Admin] Dreamworks") {
	mes "Enter Item ID to Give :";
do {
    input .@ItemID;
    if( .@ItemID < 1 ) close;
	if ( getitemname (.@ItemID) == "null")
	{
		message strcharinfo(0),"Please Enter a Valid Item ID.";
	}
	else 
	{
		mes "^ff0000Item Entered^000000 : " + getitemname(.@ItemID);
	}
} while (getitemname (.@ItemID) == "null");
mes "Enter Amount to give.";
input .@Amount;
mes "^ff0000Amount Entered^000000 : " + .@Amount;
mes "What person to recieve item.";
while (.@playerisfound != 1)
{
input .@Name$;
if (!attachrid(getcharid(3,.@Name$))) {
message strcharinfo(0),"Player not found!";
	}
	else
	{
		set .@playerisfound,1;
		mes "^ff0000Player Entered^000000 : " + .@Name$;
	}
}
next;
mes "^ff0000 Please confirm the following^000000";
mes " " ;
mes "^ff0000Name^000000 : "+.@Name$;
mes "^ff0000Item^000000 : "+getitemname(.@ItemID);
mes "^ff0000Amount^000000 : "+.@Amount;
if (select("Confirm:Cancel") == 1) {
    getitem .@ItemID,.@Amount,getcharid(3,.@Name$);
    message strcharinfo(0),"Item sent.";
    message .@Name$,"You received "+.@Amount+" "+getitemname(.@ItemID)+" from "+strcharinfo(0);
announce "Event Reward: Player "+.@Name$+" received "+.@Amount+" "+getitemname(.@ItemID)+" as Event Prize!",bc_all;
    }
close;
}
mes "Sorry, I only talk to GM"; close;
}

 

Tested and works.

  • Upvote 1
Posted

@Metamorphic

if (!attachrid(getcharid(3,.@Name$))) {

This part will attach the player named .@Name$ to the script... so the gm would be stuck

 

Just remove the attachrid part
 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...