Jump to content
Mang-Berto

Chaning v4p point rewards to cashpoint

Recommended Posts

I haven't tested this code but here's it:

*Edit* Fixed Typo

prontera,x,y,n	 script	 V4P to Cash	 n,{
function updatePoints;
function getPoints;

set [email protected], getPoints(getcharid(3));
mes "You have"[email protected];
mes "Would you like to exchange them all?";
switch ( select ("Yes","No") ) {
case 1:
updatePoints(getcharid(3), [email protected]);
break;
case 2:
break;
}
close;

function updatePoints {
set [email protected]_id,getarg(0);
set [email protected],getarg(1);
query_sql("UPDATE `cp_v4p_voters` SET points=(points-"[email protected]+") WHERE account_id='"[email protected]_id+"'");
return;
}

function getPoints {
set [email protected]_id,getarg(0);
query_sql("SELECT `points` FROM `cp_v4p_voters` WHERE account_id="[email protected]_id+" LIMIT 1",[email protected]);
if(getarraysize([email protected])==0)
return 0;
return [email protected][0];
}
}

Edited by Euro
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
Reply to this topic...

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.