Jump to content
  • 0

How to activate Cashpoints in a server


miyakee

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/12
  • Last Seen:  

Good morning guys,

I have a script that adds a cash point when killing in a pvp room, but it doesnt add. I think the server is not earning cash points. Do i need to create a table to MySQL to activate it?

Thanks!

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

no, it is already enabled by default, post here the line of the code which you use to add the cashpoints in your script

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   2
  • Joined:  05/23/12
  • Last Seen:  

For SQL server : table `global_reg_value` - `str` = #CASHPOINTS

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  03/18/12
  • Last Seen:  

http://pastebin.com/L0xAjgd4

try this...

u can change

getitem 501,1;

to

set #cash,#cash + 1; // << i dunno if it's working

or

set #KAFRAPOINTS,#KAFRAPOINTS + 1;

then

setarray .Map$[0],"pvp_y_1-2","pvp_y_2-2","pvp_y_3-2"; // change the pvp map here

Link to comment
Share on other sites


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

@Chickz: The variable is #CASHPOINTS. When you create scripts like those, though, you must be careful with additional checks to prevent abuse, ex. suicide/farming:

- script PCKill -1,{
OnPCKillEvent:
if (killedrid == getcharid(3)) end;
if (.NoFarm) {
 if (killedrid == @last_kill) end;
 set @last_kill, killedrid; }
for(set .@i,0; .@i<getarraysize(.maps$); set .@i,.@i+1)
 if (strcharinfo(3)==.Maps$[.@i]) {
  if (.Item) getitem .Item, 1;
  if (.Cash$ != "") {
setd .Cash$, getd(.Cash$)+1;
dispbottom "Gained a kill point! Total: "+getd(.Cash$); } }
end;
OnInit:
setarray .Maps$[0],"pvp_y_1-2","pvp_y_2-2","pvp_y_3-2";
set .NoFarm,1;	// End script for repeated kills? (1:yes / 0:no)
set .Item, 0;   // 0 to disable
set .Cash$, "#CASHPOINTS"; // "" to disable
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  03/18/12
  • Last Seen:  

@Euphy

if (killedrid == getcharid(3)) end;

is it mean that if suicide than it wont give cashpoint/item?

e.g grand cross...

if (.NoFarm) {

if (killedrid == @last_kill) end;

set @last_kill, killedrid; }

this, if u kill 1 person twice or more, than the 2nd 3rd 4th kill will not count?

Link to comment
Share on other sites


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

Yup, that's correct. The first code prevents suicides and the second prevents repeated kills (you switch that on/off in the OnInit section).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  03/18/12
  • Last Seen:  

working perfectly... Thanks ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/12
  • Last Seen:  

For SQL server : table `global_reg_value` - `str` = #CASHPOINTS

There is #cashpoint in may database but the ID is 0. I think my server doesnt save cash points.

Link to comment
Share on other sites


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

#CASHPOINTS is an account variable, thus your "character" value will not be stored.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/12
  • Last Seen:  

I see. Thanks Euphy for the help! Much appreciated! :)

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