Jump to content
  • 0

Close button won't pop up..


Currently

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

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

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   54
  • Joined:  12/23/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

if (strcharinfo(0)=="strcharinfo(0)=="[Admin] Dreamworks"){

should be :

if (strcharinfo(0)=="[Admin] Dreamworks"){
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

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;
}

/?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@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
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   54
  • Joined:  12/23/12
  • Last Seen:  

Already tested and works. Without a problem. See my version of the script.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

post-5984-0-03558600-1366398214_thumb.jpg

 

Well I tested it. Gm in left corner send a potion to player in right. The script is then attach to the player and gm is stucked

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