Jump to content
  • 0

Rental NPC + Voting


adrian

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

hi there,

how can i make the RENTAL ITEM NPC only can be rented with the vote points

i do have votepoint npc.

can someone give me a hint, i've been trying for a whole day

thanks

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


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

Not sure what your vote points are stored as, so assigning it as #votepoints:

set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (#votepoints < .@cost) close;
next;
if(select("Rent.:Cancel.")==2) close;
set #votepoints, #votepoints-.@cost;
rentitem item,time;
mes "Here you go!";
close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

Not sure what your vote points are stored as, so assigning it as #votepoints:

set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (#votepoints < .@cost) close;
next;
if(select("Rent.:Cancel.")==2) close;
set #votepoints, #votepoints-.@cost;
rentitem item,time;
mes "Here you go!";
close;

very thanks!!

but i added

set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (#votepoints < .@cost) close;
next;
if(select("Rent.:Cancel.")==2) close;
set #votepoints, #votepoints-.@cost;
rentitem item,time;
query_sql("UPDATE `vote_point` SET `point` = '"+.@new+"' WHERE `account_id` = '"+getcharid(3)+"'");
mes "Here you go!";
close;

erm.. i found it doesnt work because,

set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (#votepoints < .@cost) close;
next;
if(select("Rent.:Cancel.")==2) close;
set #votepoints, #votepoints-.@cost;
rentitem item,time;
mes "Here you go!";
close;

the point is not deducted

but when i add query

it goes straight to 0 even i have 55 points, it doesnt minus 1

Edited by Emistry
Please use [CODE] or [CODEBOX] Tag for Scripts. That would be nicer..
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

guys how to change with killing point?>@@a

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  210
  • Reputation:   10
  • Joined:  11/20/11
  • Last Seen:  

prontera,150,150,6,<tab>script<tab>Vote shop<tab>763,{
set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (#votepoints < .@cost) close; //If you are using cashpoints in your vote system. you should replace #votepoints with #CASHPOINTS or #KAFRAPOINTS depending on your configuration.
next;
if(select("Rent.:Cancel.")==2) close;
set #votepoints, #votepoints-.@cost; //If you are using cashpoints in your vote system. you should replace #votepoints with #CASHPOINTS or #KAFRAPOINTS depending on your configuration.
rentitem 1107,9999; // explanation: Npc will give you blade( 1107 ) for 9999 Seconds.
dispbottom "Your remaining points: "+ #votepoints;
//query_sql("UPDATE `vote_point` SET `point` = '"+.@new+"' WHERE `account_id` = '"+getcharid(3)+"'"); <- remove this line. if your variable is vote_points then replace #votepoints above.
mes "Here you go!";
close;
}

@kangferdy

change the vote points with your killing points variable. eg:

prontera,150,150,6,<tab>script<tab>Vote shop<tab>763,{
set .@cost,50;
mes "It costs "+.@cost+" vote points to rent this item.";
if (killingpoints < .@cost) close;
next;
if(select("Rent.:Cancel.")==2) close;
set killingpoints, killingpoints - .@cost;
rentitem 1107,9999; // explanation: Npc will give you blade( 1107 ) for 9999 Seconds.
mes "Here you go!";
close;
}

Edited by Emistry
Removed unnecessary line spacing..
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...