Jump to content
  • 0

Rental NPC + Voting


Question

Posted

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

5 answers to this question

Recommended Posts

Posted

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;

Posted (edited)

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..
Posted (edited)

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

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