Jump to content
  • 0

NPC skull to cashpoint


KCritz

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

Hi i wan to request a script that Skull(7420) can be exchange into a cashpoint

1 skull(7420) = 2cashpoint and you can input how many skull you want to exchange and then the npc will show how many point u've exchange and show your cash balance

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  520
  • Reputation:   64
  • Joined:  11/19/11
  • Last Seen:  

<header>{

menu "Exchange",-,"Check points",chec_k;
input .@t;
if(countitem(7420) >= .@t){
 mes "Thanks see you again. . . !";
 set $cash,.@t*2;
 delitem 7420,.@t;
 set #CASHPOINTS,#CASHPOINTS+$cash;
 close;
}else{
 mes "Not enough Skull";
 close;
}
chec_k:
 query_sql("SELECT `value` FROM `global_reg_value` WHERE account_id="+getcharid(3)+" LIMIT 1",.@points);
 dispbottom "Your Cashpoint: "+#CASHPOINTS;
 close;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

thanks sir :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

$cash

avoid using permanent global npc variable .... it can be abuseable...

change it to something like

.@cash

 query_sql("SELECT `value` FROM `global_reg_value` WHERE account_id="+getcharid(3)+" LIMIT 1",.@points);
 dispbottom "Your Cashpoint: "+#CASHPOINTS;

the query part is not needed because it's useless....also..the query...what are you trying to return ?? /hmm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

this script is very screw up =/

prontera,155,173,5    script    kjdfhksjf    100,{
   mes "you currently have "+ #cashpoints +" Cash points";
   mes "and "+( .@skulls = countitem(7420) )+" skulls";
   if ( .@skulls )
       next;
   else
       close;
   if ( input ( .@amount, 1, .@skulls ) ) {
       mes "invalid amount";
       close;
   }
   delitem 7420, .@amount;
   #cashpoints = #cashpoints + .@amount *2;
   close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

ahm ma'am annie can you help me with this i something wrong but no error on server

prontera,155,173,5	script	Skull Collector	449,{
mes "I'm collecting dead people skull.";
mes "Hmm... well well looks like you have something there aye!";
mes " ";
mes " ";
mes " ";
mes "Let me just check it.............";
next;
mes "You have "+( .@skulls = countitem(7420) )+" skulls";
mes "And";
mes "You currently have "+ #cashpoints +" Cash points";
if ( .@skulls )
	next;
else
mes "I don't see any Skulls you have >_< so get LOSS! you wasting my time.";
	close;
if ( input ( .@amount, 1, .@skulls ) ) {
	mes "invalid amount";
	close;
delitem 7420, .@amount;
#cashpoints = #cashpoints + .@amount *2;
dispbottom "[ Cash ] Gained "+.cashpoint+" Points. Total : "+@cashopoints+" Points.";
close;
}
end;
}

well i just edit the script you gave and add some the input menu not showing it just goin next and next then close

Edited by KCritz
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

else{
mes "I don't see any Skulls you have >_< so get LOSS! you wasting my time.";
 close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

wow your script also very screw up :ani_swt3:

prontera,155,173,5	script	Skull Collector	449,{
mes "I'm collecting dead people skull.";
mes "Hmm... well well looks like you have something there aye!";
mes " ";
mes " ";
mes " ";
mes "Let me just check it.............";
next;
mes "You have "+( .@skulls = countitem(7420) )+" skulls";
mes "And";
mes "You currently have "+ #cashpoints +" Cash points";
next;
if ( !.@skulls ) {
	mes "I don't see any Skulls you have >_< so get LOSS! you wasting my time.";
	close;
}
if ( input ( .@amount, 1, .@skulls ) ) {
	mes "invalid amount";
	close;
}
delitem 7420, .@amount;
#cashpoints = #cashpoints + .@amount *2;
dispbottom "[ Cash ] Gained "+( .@amount *2 )+" Points. Total : "+ #cashpoints +" Points.";
mes "Gained "+( .@amount *2 )+" Points.";
mes "Total : "+ #cashpoints +" Points.";
close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  12/23/12
  • Last Seen:  

/ok hehe stil nub at scripting thanks anyway both of you
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...