miyakee Posted June 23, 2012 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
EvilPuncker Posted June 23, 2012 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
Aksl Posted June 23, 2012 Posted June 23, 2012 For SQL server : table `global_reg_value` - `str` = #CASHPOINTS Quote
Chickz Posted June 23, 2012 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
Euphy Posted June 23, 2012 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
Chickz Posted June 23, 2012 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
Euphy Posted June 23, 2012 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
miyakee Posted July 2, 2012 Author 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
Euphy Posted July 2, 2012 Posted July 2, 2012 #CASHPOINTS is an account variable, thus your "character" value will not be stored. Quote
miyakee Posted July 2, 2012 Author Posted July 2, 2012 I see. Thanks Euphy for the help! Much appreciated! Quote
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!
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.