Jump to content
  • 0

H> PVP script with PVP Ladder


Erba

Question


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

Hello, i am using this kind of PVP Warper with PVP Ladder Script, the script is originally created by Sir Brian

this script doesnt have any errors but it doesnt add kills or deaths when a player kills or dies inside a pvp or gvg  mapflag.

i am using rathena 16797..

 

Help is greatly appreciated thank you!

prontera,161,187,5	script	PVP Master	86,{
mes "[PvP Warper]";
if(.locked){mes "Sorry, PVP Rooms are Locked During WOE."; close;}
mes "Which arena do you want to go to?";
switch(select("View PvP stats of my Char:PVP Square ["+getmapusers("cell_game")+"/100]:PVP NoPotion ["+getmapusers("cell_game2")+"/100]:Non Donator PVP ["+getmapusers("cell_game3")+"/100]:GvG Arena [^FF0000" + getmapusers("guild_vs3") + "^000000/100]")) {
case 1: // VIEW STATUS
		mes "Your PvP stats are:";
		query_sql ("SELECT `char`.`kills` FROM `char` WHERE `char`.`char_id` = "+ getcharid(0), .@kills);
		query_sql ("SELECT `char`.`deaths` FROM `char` WHERE `char`.`char_id` = "+ getcharid(0), .@deaths);
		mes "^009500     Kills: " + .@kills;
		mes "^FF0000     Deaths: " + .@deaths;
		break;
	default:
		break;

case 2: // PVP Square
if (getmapusers("cell_game") > 99) callsub S_full;
warp "cell_game",0,0;
end;

case 3: // PVP NoPotion
if (getmapusers("cell_game2") > 99) callsub S_full;
warp "cell_game2",0,0;
end;

case 4: // Non Donator PVP
if (getmapusers("cell_game3") > 99) callsub S_full;
warp "cell_game3",0,0;
end;

case 5: // GVG
if (getmapusers("guild_vs3") > 99) callsub S_full;
if (!getcharid(2)) {
	mes " ";
	mes "Please join a guild before entering...";
	close;
}
		warp "guild_vs3",0,0;
		end;

}
close;

S_full:
mes " ";
mes "I'm sorry, this arena is full. Please try again later...";
close;

OnInit:
waitingroom "Special PVP/GVG",0;
end;

//======================================
//	OnPCKillEvent
//======================================

OnPCKillEvent:
	getmapxy(.@map$,.@x,.@y, 0);
	set .@killer$, strcharinfo(0);
	
	if( getmapflag(.@map$,mf_gvg) ) {
		// on GVG maps, and during WoE
		query_sql "UPDATE `char` SET `kills` = `kills`+1 WHERE `char_id` = "+ getcharid(0);
		query_sql "SELECT `kills` FROM `char` WHERE `char_id` = "+ getcharid(0), .@kills;
		dispbottom "You have killed "+ rid2name(killedrid) +". [Total Kills = "+ .@kills +"]";
		if (attachrid(killedrid)) {
			query_sql "UPDATE `char` SET `deaths` = `deaths`+1 WHERE `char_id` = "+ getcharid(0);
			query_sql "SELECT `deaths` FROM `char` WHERE `char_id` = "+ getcharid(0), .@deaths;
			dispbottom "You have been killed by "+ .@killer$ +". [Total Deaths = "+ .@deaths +"]";
		}
	} else if( getmapflag(.@map$,mf_pvp) ) {
		// on PVP and Battleground maps
		dispbottom "You have killed "+ rid2name(killedrid) +".";
		if (attachrid(killedrid)) {
			dispbottom "You have been killed by "+ .@killer$ +".";
		}
	}
	end;

Edited by Erba
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

this script is expecting the `char` table already has `kills` and `deaths` column

make sure that you have run

alter table `char`
add `kills` int(11) unsigned not null default 0 after unban_time,
add `deaths` int(11) unsigned not null default 0 after `kills`;
also, your getmapflag mf_gvg inside OnPCKillEvent seems to be doing correctly

but mf_pvp doesn't add the query_sql stuffs ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

this script is expecting the `char` table already has `kills` and `deaths` column

make sure that you have run

alter table `char`
add `kills` int(11) unsigned not null default 0 after unban_time,
add `deaths` int(11) unsigned not null default 0 after `kills`;
also, your getmapflag mf_gvg inside OnPCKillEvent seems to be doing correctly

but mf_pvp doesn't add the query_sql stuffs ...

 

i successfully added those sql queries in my phpmyadmin database mam annie but still the problem is that it doesnt add a Kills or Deaths upon pvping in PVP or GVG arenas

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

spoon feed

[paste=8fxz3irmld9]

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

sorry im not that good in making scripts specially when dealing with sql queries , and thankyou for spoon feeding me mam, thank you again ill try this later

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