Danzon 4 Posted March 22, 2014 (edited) Hello guys , I have a little problem with PVP Script and 1 NPC So this is the problem , everytime player logout , this will happen this is the script ( not the full script ) : OnPCLogoutEvent: if($icaSystem){if(getgmlevel() >= $icaGMLevel){ end; } for(set .@i, 0; .@i <= 127; set .@i, .@i + 1) { if((@mcountss[.@i] > 3) && (@mcountss[.@i] < $icaFeed)){ set NemesisKill, NemesisKill + 1; } if(@mcountss[.@i] >= $icaFeed){set FeedCount, FeedCount + 1;} if (.@i==127) {break;} } if($icaServerType){ query_sql("REPLACE INTO `pvp_rank` (`char_id`, `account_id`, `char`, `kill`, `death`, `kdr`, `killingstreak`, `multikill`, `nemesiskill`, `feedcount`,`killingspree`, `dominating`, `megakill`, `unstoppable`, `wickedsick`, `monsterkill`, `godlike`, `beyondgodlike`, `doublekill`, `triplekill`, `ultrakill`, `rampage`, `ownage`) VALUES ("+getcharid(0)+","+getcharid(3)+", '"+rid2name(getcharid(3))+"', "+Kill+", "+Death+", '"+callfunc("KDR_Calculator", Kill, Death)+"', "+KillingStreak+", "+MultiKill+", "+NemesisKill+", "+FeedCount+", "+KillingSpree+", "+Dominating+", "+MegaKill+", "+Unstoppable+", "+WickedSick+", "+MonsterKill+", "+Godlike+", "+BeyondGodlike+", "+DoubleKill+", "+TripleKill+", "+UltraKill+", "+Rampage+", "+Ownage+")"); } if($icaPvPMap$[0] != "All"){ for(set .@i, 0; .@i < (getarraysize($icaPvPMap$) - 1); set .@i, .@i + 1){ if(strcharinfo(3) != $icaPvPMap$[.@i]){ end; } } } } set #streak,1; set #streak$,"None"; set #multikill,0; set #multikillCTR,0; set NemesisKilled,0; set #nm,0; set #mcount,0; set #killer$,"NONE"; set #killed$,"NONE"; setarray @killers$[0],"none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none"; setarray @mcounts[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; setarray @killed$[0],"none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none","none"; setarray @mcountss[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;end;OnMultiKillTrigger: set #multikill,0; set #multikillCTR,0;end; Can somebody fix this ? And my second problem is this , I don't know what is this :x Please help me , thanks Hercules Edited March 22, 2014 by Max Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted March 22, 2014 Your player name's has a ' inbetween their nickname, so it breaks the text part. Examples: (see the coloring on the text) Broken string: 'Wolf O'Donnell'; Correct string: 'Wolf O'Donnell'; I've escaped the ' after the O so that it's taken as a literal ' on the string and thus will not be taken as a string end with a weird extension the MySQL engine won't know how to parse making it broken. More (extensive) info on this: http://php.net/mysqli_real_escape_string But you can't manually escape the char names since you don't know what they can contain, so you can use the escape_sql script command for that, which will handle it for you without any added problems other than editing your current SQL statement. P.S.: Nope, you can't unescape them without doing some minor string magic yourself . 1 Danzon reacted to this Quote Share this post Link to post Share on other sites
0 Danzon 4 Posted March 23, 2014 (edited) Your player name's has a ' inbetween their nickname, so it breaks the text part. Examples: (see the coloring on the text) Broken string: 'Wolf O'Donnell'; Correct string: 'Wolf O'Donnell'; I've escaped the ' after the O so that it's taken as a literal ' on the string and thus will not be taken as a string end with a weird extension the MySQL engine won't know how to parse making it broken. More (extensive) info on this: http://php.net/mysqli_real_escape_string But you can't manually escape the char names since you don't know what they can contain, so you can use the escape_sql script command for that, which will handle it for you without any added problems other than editing your current SQL statement. P.S.: Nope, you can't unescape them without doing some minor string magic yourself . Thanks , you are the man ! Both problem fixed , second problem because im using @reloadscript when the script running. Edited March 24, 2014 by Max Quote Share this post Link to post Share on other sites
Hello guys , I have a little problem with PVP Script and 1 NPC
So this is the problem , everytime player logout , this will happen
this is the script ( not the full script ) :
Can somebody fix this ?
And my second problem is this , I don't know what is this :x
Please help me , thanks Hercules
Edited by MaxShare this post
Link to post
Share on other sites