Jump to content
  • 0

V4P support Please.


emelie415

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

First i'd like to say im a new member of Rathena.

I start with explaining what type of server i have, and what my problem and what i want to achieve.

My sever is "Cash Point" server. Meaning; when you kill another player you'll recieve "Cash Points"  So i cant have a v4p system with Cash Points.
Also i cannot use TCG or CREDITS because these are used in quests.

So in Addon.php i choose  "USE CREDITS> TRUE"   I want my v4p to give poring coin or something like that.

I found this : http://upaste.me/937a6913934e782

As you see at the end:  I want this to work; That you'll recieve 7539 (poring coin)

// This NPC change 1 Poring Coint for 1 Vote Point
prontera,147,166,5      script  Akaru#002       437,{
        callfunc "VoteExchange",strnpcinfo(1),1,7539,1;


I uploaded both  [Addon.php] & [v4p.txt]   so you can have a look, and see if there are any buggs.


Problem; When i click V4p npc i do not recieve any Poring Coins.

I appreciate any kind of help!

Thanks alot,
Regards
Emmie

 

addon.php

v4p.txt

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

I read the script really quickly so I didn't really get what you want to do but I know one thing for sure.

You won't be able to use this function if you don't attach the player rid to it because functions are not attached to players automatically.

 

It's a bit strange that Mytzer submitted it like this because at first sight it seems obvious that it won't work :huh:

 

Maybe he found a way to use his function without attaching any rid but normally you can't.

 

So basically you'd have to give the player rid as a parameter to the function so that it can attach the player to the script before using message commands:

Just add an argument like this:

 callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0));

and attach the rid in the function:

function        script  VoteExchange    { attachrid(getarg(4));

        set .@CurrVotePoints, callfunc("getVotePoints");
...
Edited by Kurofly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

 

I read the script really quickly so I didn't really get what you want to do but I know one thing for sure.

You won't be able to use this function if you don't attach the player rid to it because functions are not attached to players automatically.

 

It's a bit strange that Mytzer submitted it like this because at first sight it seems obvious that it won't work :huh:

 

Maybe he found a way to use his function without attaching any rid but normally you can't.

 

So basically you'd have to give the player rid as a parameter to the function so that it can attach the player to the script before using message commands:

Just add an argument like this:

 callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0));

and attach the rid in the function:

function        script  VoteExchange    { attachrid(getarg(4));

        set .@CurrVotePoints, callfunc("getVotePoints");
...

I was waiting for you to reply! I  saw you was reading my topic, i was wishing that you'd know the answer!  My wish came true =) Thank you alot. I will now test that

Waiting again but.

Where should this be?

callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0));

And where should the 2nd be?

function script VoteExchange { attachrid(getarg(4));

set .@CurrVotePoints, callfunc("getVotePoints");

...

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Take you current script and look for all of these

callfunc "VoteExchange",strnpcinfo(1),1,7539,1;

then turn them to this

callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0));

then look for tis one

function script VoteExchange {

and turn it to this

function script VoteExchange { attachrid(getarg(4));
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

Ive done it. Now  my   v4p.txt looks like this ;

http://upaste.me/18d41934767b842ef

Thank you for explaining so much details =)


Ive done it. Now  my   v4p.txt looks like this ;

http://upaste.me/18d41934767b842ef

Thank you for explaining so much details =)

Forgott to say, its not working =/  i did @reloadscript
Is there more to do? Can we teamview?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Did you add your script location in trunk/npc/scripts_custom.conf ??

If yes, what excatly doesn't work? What happens you you click on your NPC? Do you have errors on your mapserv?

 

I'm gonna go eating I'll come back in a few minutes.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

Did you add your script location in trunk/npc/scripts_custom.conf ??

If yes, what excatly doesn't work? What happens you you click on your NPC? Do you have errors on your mapserv?

 

I'm gonna go eating I'll come back in a few minutes.

Yes ive added it to scripts_custom.conf..... When i click on v4p npc ; it will tell me the following:

Hello Admin, i'm V4P

i'm offering 1 poring coing for each 1 Vote point you pay.

Vote for us and win Vote points!

But i dont recieve any points =/

 

Did you add your script location in trunk/npc/scripts_custom.conf ??

If yes, what excatly doesn't work? What happens you you click on your NPC? Do you have errors on your mapserv?

 

I'm gonna go eating I'll come back in a few minutes.

Yes ive added it to scripts_custom.conf..... When i click on v4p npc ; it will tell me the following:

Hello Admin, i'm V4P

i'm offering 1 poring coing for each 1 Vote point you pay.

Vote for us and win Vote points!

But i dont recieve any points =/

 

Eat well ! Can we teamview after u've eaten? If we solve it, i will explain it here by words. How we solved it.

Regards,

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Ok I get it.

This script uses sql tables so you need to create them in order to get this working.

and also if the NPC tells you to vote, it's because you don't have enough vote points to get any reward.

 

Look at this line:

// Retrieve the Vote Points: For use with FluxCP Addon: Vote For Points 1.2 by JayPee Mateo

 

Look for this while I eat, see you later ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

I didnt really get what you ment by "Sql tables"  And "Create them in order to get this working"  If we could teamview 240 480 009   // 5051   i could show u how many v4p points i have and so on. I think its easier when u see it live =) U can watch while eat, IF you eat infront of ur pc.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

I don't know anything about flux but I know you'll have to make use of sql tables to store the data you need to get this working.

Your script is supposed to be used with FluxCP Addon: Vote For Points 1.2 by JayPee Mateo so if you don't have it already download it.

Then here is what you need to do in order to create the sql tables:

 

  • Open up your MySql Workbench (you should have made use of it when you created you server)

post-27270-0-20388000-1432390018_thumb.png

  • Connect to your Sql server

post-27270-0-92097500-1432389998_thumb.png

  • Click File >> Open SQL Script...

post-27270-0-34212900-1432390001_thumb.png

  • Open voteforpoints/schemas/logindb/cp_v4p_sites.sql

post-27270-0-14444500-1432390004_thumb.png

  • Execute the script

post-27270-0-43710000-1432390006_thumb.png

  • Select 'edit table' on the table you just created and fill in the values (I suppose)

post-27270-0-85424300-1432390008_thumb.png

Sorry can't help you there I have no idea what these are...

  • Repeat from 'Click File >> Open SQL Script...' step to here opening voteforpoints/schemas/logindb/cp_v4p_votelogs.sql

post-27270-0-95356400-1432390012_thumb.png

You probably don't have to edit this one but I'm not sure..

  • Repeat from 'Click File >> Open SQL Script...' step to 'Execute the script' step opening voteforpoints/schemas/logindb/cp_v4p_voters.sql

post-27270-0-11611100-1432390015_thumb.png

You don't have to edit this table

Edited by Kurofly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  04/15/15
  • Last Seen:  

This is WORKBENCH mode, i do not use workbench to access these. I have VPS server, not local PC host....

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