Jump to content
  • 0
Sign in to follow this  
Danzon

Script error with pict

Question

Hello guys , I have a little problem with PVP Script and 1 NPC

 

So this is the problem , everytime player logout , this will happen

 

post-454-0-61269600-1395519231_thumb.png

post-454-0-33185700-1395519235_thumb.png

post-454-0-37891100-1395519250_thumb.png

 

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

 

post-454-0-32910800-1395519254_thumb.png

 

 

 

 

 

Please help me , thanks Hercules :)

Edited by Max

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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 .

Share this post


Link to post
Share on other sites
  • 0

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 by Max

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.