Jump to content
  • 0
Craves

Request for a simple PVP Announcer..

Question

I've seen a lot of PvP Announcers including AnnieRuru's Dota announcer, but I'm wondering if anyone could make me a simple one?

Basically what I'm using now only announces : Player 1 has killed Player 2 in xxx_fild01.

But I'm wondering if anyone could teach me how to let it show the streak of the kills behind the announcement, such as : Player 1 has killed Player 2 in xxx_fild01. [10]

Hopefully someone could help me with this. Thanks in advance.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Here a reduce version of script that I'm using, it's only for SQL all stats can be saved.

SQL lines to add in your data :

//ALTER TABLE `char` ADD COLUMN `pvp_Kill` INTEGER UNSIGNED NOT NULL DEFAULT '0' AFTER `rename`;
//ALTER TABLE `char` ADD COLUMN `pvp_Death` INTEGER UNSIGNED NOT NULL DEFAULT '0' AFTER `rename`;

-    script    C_login    -1,{


OnInit:

//For set map used
setarray $pvpmap$[0],"pvp_map1","pvp_map2","pvp_map3";


OnPCDieEvent:

getmapxy @map$,@x,@y,0;

//For PvP maps
  for( set [email protected], 0; [email protected] < getarraysize($pvpmap$); set [email protected], [email protected] +1 )
   if (@map$ == $pvpmap$[[email protected]]) {

       set [email protected],getcharid(0); //Char ID
       set [email protected],strcharinfo(0); //Char ID

//For killstreak, you can add more lines - Change announce.

       set @killstreak,0;
       set @deathstreak,@deathstreak+1;
       if (@deathstreak == 5) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] Kills without be killed !",bc_map;}
       if (@deathstreak == 10) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] Kills without be killed !",bc_map;}
       if (@deathstreak == 15) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] Kills without be killed !",bc_map;}
       if (@deathstreak == 20) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] Kills without be killed !",bc_map;}

       //Par Joueur
       query_sql("SELECT `pvp_Death` FROM `char` WHERE `char_id` = '"[email protected]+"'",[email protected]); //Check name
       setarray [email protected][0],[email protected][0]+1;
       query_sql "UPDATE `char` SET `pvp_Death` = '"[email protected][0]+"' WHERE `char_id` ='"[email protected]+"'";
       }

   //============================= Bottom

       if(killerrid==0) {dispbottom "You just killed yourself.";end;}
       set @killer$, rid2name(killerrid);
       dispbottom "You have been killed by "[email protected]$+"!";
       end;

   //=================================================================================

OnPCKillEvent:


getmapxy @map$,@x,@y,0;

  for( set [email protected], 0; [email protected] < getarraysize($pvpmap$); set [email protected], [email protected] +1 )
   if (@map$ == $pvpmap$[[email protected]]) {

       set [email protected],getcharid(0); //Char ID
       set [email protected],strcharinfo(0);

       set @deathstreak,0;
       set @killstreak,@killstreak+1;
       if (@killstreak == 5) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] died without kill !",bc_map;}
       if (@killstreak == 10) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] died without kill !",bc_map;}
       if (@killstreak == 15) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] died without kill !",bc_map;}
       if (@killstreak == 20) {mapannounce ""[email protected]$+"",""[email protected]+" : ["[email protected]+"] died without kill !",bc_map;}

       //Par Joueur
       query_sql("SELECT `pvp_Kill` FROM `char` WHERE `char_id` = '"[email protected]+"'",[email protected]); //Verif le nom
       setarray [email protected][0],[email protected][0]+1;
       query_sql "UPDATE `char` SET `pvp_Kill` = '"[email protected][0]+"' WHERE `char_id` ='"[email protected]+"'";
       }


   //============================= Bottom

  	 set @killed$, rid2name(killedrid);
       if(strcharinfo(0)[email protected]$) {end;}
       dispbottom "You have kill "[email protected]$+"!";
       end;

}

Link to comment
Share on other sites

Erm..I've got some question regarding that.. I've made the sql addition, and i've edited some of the script for that.. but seems like every time i kill 1 player, it announces that i killed that player 3 times..and the kill count increases 3 in the sql..

This is basically my script.. can you have a look at it? Thank you..

- script C_login -1,{

OnInit:
//For set map used
setarray $pvpmap$[0],"izlude","pvp_map2","pvp_map3";

OnPCKillEvent:

getmapxy @map$,@x,@y,0;
 for( set [email protected], 0; [email protected] < getarraysize($pvpmap$); set [email protected], [email protected] +1 )
if (@map$ == $pvpmap$[[email protected]]) {
 set [email protected],getcharid(0); //Char ID
 set [email protected],strcharinfo(0);
 set @deathstreak,0;
 set @killstreak,@killstreak+1;
 if (@killstreak >= 1) {announce ""[email protected]+" had just killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".["[email protected]+"]",bc_map;}
//Par Joueur
 query_sql("SELECT `pvp_Kill` FROM `char` WHERE `char_id` = '"[email protected]+"'",[email protected]); //Verif le nom
 setarray [email protected][0],[email protected][0]+1;
 query_sql "UPDATE `char` SET `pvp_Kill` = '"[email protected][0]+"' WHERE `char_id` ='"[email protected]+"'";
 }
}

Link to comment
Share on other sites

You need to add the OnPCDieEvent: for reset the killstreak value. You can also add a trigger to reset the value if the player leave the map. With a @ variable kind, the value is only rested when you log out.

But with this part of script, I don't see why it adds 3 kills per kill if there is no other . Reduce the

setarray $pvpmap$[0],"izlude","pvp_map2","pvp_map3";

to

setarray $pvpmap$[0],"izlude";
Link to comment
Share on other sites

did you duplicated the script ? or loaded it several times ? both condition i mention will also result in wrong kill count increment...

coz i also experienced this problem last time..xD

the kill counter increase alot due to the duplicated wrong npc / method..

Link to comment
Share on other sites

@Emistry , I only have 1 script for this pvp announcer.. what do you mean by loaded it several times? Sorry, I'm quite new on these stuffs.. :)

@Aerie , Erm..it doesn't fix it..it still announces 3 times when I only kill the opponent once..

This is the edited script..

- script C_login -1,{

OnInit:
setarray $pvpmap$[0],"izlude";

OnPCKillEvent:
getmapxy [email protected]$, [email protected], [email protected], 0;
 for( set [email protected], 0; [email protected] < getarraysize($pvpmap$); set [email protected], [email protected] +1 )
if (@map$ == $pvpmap$[[email protected]]) {

 set @killstreak, @killstreak + 1;
 if (@killstreak <= 3) {announce ""+strcharinfo(0)+" had just killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".",bc_map;}
 if (@killstreak >= 3) {announce ""+strcharinfo(0)+" had just killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".["[email protected]+"]",bc_all;}

}
OnPCDieEvent: 
getmapxy @map$,@x,@y,0;
 for( set [email protected], 0; [email protected] < getarraysize($pvpmap$); set [email protected], [email protected] +1 )
if (@map$ == $pvpmap$[[email protected]]) {
 if (@killstreak >= 3) {announce ""+rid2name(killedrid)+" had just ended "+strcharinfo(0)+"'s ["[email protected]+"] streak at "+strcharinfo(3)+".",bc_all;}
 set @killstreak,0;
}
}

Any idea what seems to be the problem? /no1

Thank you for you helps ^_^ I found out a way to make it work..as simple as i wanted ^_^ Thanks guys..

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

Important Information

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