myserver Posted September 14, 2018 Posted September 14, 2018 (edited) Every killed on pvp area the player have a cashpoint but she/he lose detactive or lose 1 point every die inside of the pvp area . then the npc check the ip of the player if the same to other player inside of pvp area she/he not allowed to enter Edited September 14, 2018 by Jard Quote
0 myserver Posted September 14, 2018 Author Posted September 14, 2018 (edited) - script PVPPOINTS -1,{ OnPCKillEvent: getmapxy.@map$,.@x,.@y,0; if(getcharid(3)==killedrid) end; if(.@map$ != "pvp_y_1-2") end; set .@player1, getcharid(3); set .@player2, killedrid; attachrid(.@player2); set .@player2points, #CASHPOINTS; if(.@player2points) { set #CASHPOINTS, #CASHPOINTS - 1; dispbottom "You Lost 1 Cash Point from "+rid2name(killerrid); } emotion e_sob,1; attachrid(.@player1); if(.@player2points) { set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "You Gained 1 Cash Points from "+rid2name(killedrid); } else dispbottom "Sorry no cash points on the "+rid2name(killedrid); emotion e_meh,1; end; } how to add a npc then how the npc how many player inside of the map Edited September 14, 2018 by Jard Quote
0 hendra814 Posted September 14, 2018 Posted September 14, 2018 36 minutes ago, Jard said: - script PVPPOINTS -1,{ OnPCKillEvent: getmapxy.@map$,.@x,.@y,0; if(getcharid(3)==killedrid) end; if(.@map$ != "pvp_y_1-2") end; set .@player1, getcharid(3); set .@player2, killedrid; attachrid(.@player2); set .@player2points, #CASHPOINTS; if(.@player2points) { set #CASHPOINTS, #CASHPOINTS - 1; dispbottom "You Lost 1 Cash Point from "+rid2name(killerrid); } emotion e_sob,1; attachrid(.@player1); if(.@player2points) { set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "You Gained 1 Cash Points from "+rid2name(killedrid); } else dispbottom "Sorry no cash points on the "+rid2name(killedrid); emotion e_meh,1; end; } how to add a npc then how the npc how many player inside of the map that script doesn't need npc to check how many player on pvp map you must create pvp warper, you could try this prontera.gat,148,192,4 script Ultimate PvP Warper 417,{ if (.pvp_square$=="") donpcevent "Ultimate PVP warper::OnClock0000"; mes "[PvP Warper]"; mes "Which arena do you want to enter ?"; switch(select("All Job ["+getmapusers(.pvp_square$)+"/128]:Max lvl 99 ["+getmapusers("pvp_y_2-2")+"/128]:3rd Baby Class ["+getmapusers("pvp_y_1-2")+"/128]")) { case 1: // PVP Square if (getmapusers(.pvp_square$) > 127) callsub S_full; warp .pvp_square$,0,0; announce "Player "+strcharinfo(0)+" enter PVP All Job !!",bc_all; end; case 2: // PVP Low Level if (getmapusers("pvp_y_2-2") > 127) callsub S_full; if (BaseLevel > 99) { // Edit 150 to any maximum Lvl of a player can enter this room mes "only player with Level 1 - 99 can enter this arena"; close; } warp "pvp_y_2-2",0,0; announce "Player "+strcharinfo(0)+" enter PVP Max lvl 99 !!",bc_all; end; Case 3: // Baby Class if (getmapusers("pvp_y_1-2") > 127) callsub S_full; if (class < 4096 || class > 4112) goto L_NotBaby; warp "pvp_y_1-2",0,0; announce "Player "+strcharinfo(0)+" enter PVP 3rd Baby Class !!",bc_all; end; L_NotBaby: mes "This room only for 3rd baby class"; close; } S_full: mes "Sorry, this arena already full. please wait a while..."; close; OnInit: OnTimer5000: delwaitingroom; switch(rand(1,3)) { Case 1: waitingroom getmapusers(.pvp_square$)+" player"+( getmapusers(.pvp_square$) > 1 ? "s":"") +" in the arena All Job", 0; goto Timer; end; break; Case 2: waitingroom getmapusers("pvp_y_2-2")+" player"+( getmapusers("pvp_y_2-2") > 1 ? "s":"") +" in the arena Max lvl 99", 0; goto Timer; end; break; Case 3: waitingroom getmapusers("pvp_y_1-2")+" player"+( getmapusers("pvp_y_1-2") > 1 ? "s":"") +" in the arena 3rd Baby Class", 0; goto Timer; end; break; Timer: initnpctimer; } OnClock0000: // set the "PVP Square" map, based on day of the weeek switch(gettime(4)) { case 0: // Sunday case 1: // Monday set .pvp_square$, "pvp_y_7-2"; break; case 2: // Tuesday case 3: // Wednesday set .pvp_square$, "guild_vs3"; break; case 4: // Thursday case 5: // Friday set .pvp_square$, "pvp_y_7-2"; break; case 6: // Saturday set .pvp_square$, "guild_vs3"; break; } } Quote
0 hendra814 Posted September 14, 2018 Posted September 14, 2018 7 hours ago, Jard said: i need to add a npc bro for how many player in the map try this Spoiler prontera.gat,143,192,4 script PvPPOINT 417,{ Oninit: OnTimer5000: delwaitingroom; waitingroom getmapusers("pvp_y_1-2")+" player"+( getmapusers("pvp_y_1-2") > 1 ? "s":"") +" in the map", 0; goto Timer; end; Timer: initnpctimer; OnPCKillEvent: getmapxy.@map$,.@x,.@y,0; if(getcharid(3)==killedrid) end; if(.@map$ != "pvp_y_1-2") end; set .@player1, getcharid(3); set .@player2, killedrid; attachrid(.@player2); set .@player2points, #CASHPOINTS; if(.@player2points) { set #CASHPOINTS, #CASHPOINTS - 1; dispbottom "You Lost 1 Cash Point from "+rid2name(killerrid); } emotion e_sob,1; attachrid(.@player1); if(.@player2points) { set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "You Gained 1 Cash Points from "+rid2name(killedrid); } else dispbottom "Sorry no cash points on the "+rid2name(killedrid); emotion e_meh,1; end; } to prevent dual on pvp you can try this Spoiler - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); if(!compare(.tmp$,.@charmap$)) end; set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE`account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` =(SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND`online` <> 0;",.@a); for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { if(!getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])) && .@charmap$==.@map$) set .@c,.@c+ 1; } if(.@c > .limitacc ) { dispbottom "Dual accounts not allowed in PVP."; warp "prontera",0,0; } end; OnInit: set .limitacc,1; setarray .maps$,"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5","turbo_e_4","turbo_e_8","turbo_e_16", "pvp_y_1-1","pvp_y_1-2","pvp_y_1-3","pvp_y_1-4","pvp_y_1-5","pvp_y_2-1","pvp_y_2-2","pvp_y_2-3","pvp_y_2-4","pvp_y_2-5", "pvp_y_3-1","pvp_y_3-2","pvp_y_3-3","pvp_y_3-4","pvp_y_3-5","pvp_y_4-1","pvp_y_4-2","pvp_y_4-3","pvp_y_4-4","pvp_y_4-5", "pvp_y_5-1","pvp_y_5-2","pvp_y_5-3","pvp_y_5-4","pvp_y_5-5","pvp_y_6-1","pvp_y_6-2","pvp_y_6-3","pvp_y_6-4","pvp_y_6-5", "pvp_y_7-1","pvp_y_7-2","pvp_y_7-3","pvp_y_7-4","pvp_y_7-5","pvp_y_8-1","pvp_y_8-2","pvp_y_8-3","pvp_y_8-4","pvp_y_8-5", "pvp_n_1-1","pvp_n_1-2","pvp_n_1-3","pvp_n_1-4","pvp_n_1-5","pvp_n_2-1","pvp_n_2-2","pvp_n_2-3","pvp_n_2-4","pvp_n_2-5", "pvp_n_3-1","pvp_n_3-2","pvp_n_3-3","pvp_n_3-4","pvp_n_3-5","pvp_n_4-1","pvp_n_4-2","pvp_n_4-3","pvp_n_4-4","pvp_n_4-5", "pvp_n_5-1","pvp_n_5-2","pvp_n_5-3","pvp_n_5-4","pvp_n_5-5","pvp_n_6-1","pvp_n_6-2","pvp_n_6-3","pvp_n_6-4","pvp_n_6-5", "pvp_n_7-1","pvp_n_7-2","pvp_n_7-3","pvp_n_7-4","pvp_n_7-5","pvp_n_8-1","pvp_n_8-2","pvp_n_8-3","pvp_n_8-4","pvp_n_8-5", "pvp_2vs2"; set .lens , getarraysize(.maps$) ; for(set(.a,0);.a<.lens;set(.a,.a+1)) { setmapflag .maps$[.a], mf_loadevent ; set .tmp$ ,.tmp$+.maps$[.a]+","; } } Quote
Question
myserver
Every killed on pvp area the player have a cashpoint but she/he lose detactive or lose 1 point every die inside of the pvp area . then the npc check the ip of the player if the same to other player inside of pvp area she/he not allowed to enter
Edited by Jard4 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.