miyakee Posted June 23, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 25 Reputation: 0 Joined: 05/18/12 Last Seen: November 25, 2015 Share Posted June 23, 2012 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! Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted June 23, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Share Posted June 23, 2012 no, it is already enabled by default, post here the line of the code which you use to add the cashpoints in your script Quote Link to comment Share on other sites More sharing options...
Aksl Posted June 23, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 35 Reputation: 2 Joined: 05/23/12 Last Seen: September 27, 2014 Share Posted June 23, 2012 For SQL server : table `global_reg_value` - `str` = #CASHPOINTS Quote Link to comment Share on other sites More sharing options...
Chickz Posted June 23, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 03/18/12 Last Seen: April 19, 2020 Share Posted June 23, 2012 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 Quote Link to comment Share on other sites More sharing options...
Euphy Posted June 23, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted June 23, 2012 @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; } Quote Link to comment Share on other sites More sharing options...
Chickz Posted June 23, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 03/18/12 Last Seen: April 19, 2020 Share Posted June 23, 2012 @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? Quote Link to comment Share on other sites More sharing options...
Euphy Posted June 23, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted June 23, 2012 Yup, that's correct. The first code prevents suicides and the second prevents repeated kills (you switch that on/off in the OnInit section). Quote Link to comment Share on other sites More sharing options...
Chickz Posted June 23, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 03/18/12 Last Seen: April 19, 2020 Share Posted June 23, 2012 working perfectly... Thanks ^^ Quote Link to comment Share on other sites More sharing options...
miyakee Posted July 2, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 25 Reputation: 0 Joined: 05/18/12 Last Seen: November 25, 2015 Author Share Posted July 2, 2012 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. Quote Link to comment Share on other sites More sharing options...
Euphy Posted July 2, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted July 2, 2012 #CASHPOINTS is an account variable, thus your "character" value will not be stored. Quote Link to comment Share on other sites More sharing options...
miyakee Posted July 2, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 25 Reputation: 0 Joined: 05/18/12 Last Seen: November 25, 2015 Author Share Posted July 2, 2012 I see. Thanks Euphy for the help! Much appreciated! Quote Link to comment Share on other sites More sharing options...
Question
miyakee
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.