AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need Help With XP (https://forums.alliedmods.net/showthread.php?t=278358)

Shockyboy 01-30-2016 06:10

Need Help With XP
 
1 Attachment(s)
I want to add few new things in to this plugin im bad at coding so i didnt try, so every time i try i end up with not compling my plugin and 100s of erros so i gave up i want to add these feature

2 Frags -> Double KILL
3 Frags -> TRIPLE KILL
5 Frags -> MULTI KILL
6 Frags -> RAMPAGE
7 Frags -> KILLING SPREE
9 Frags -> DOMINATING
11 Frags -> UNSTOPPABLE
13 Frags -> MEGA KILL
15 Frags -> ULTRA KILL
16 Frags -> EAGLE EYE
17 Frags -> OWNAGE
18 Frags -> LUDICROUS KILL
19 Frags -> HEAD HUNTER
20 Frags -> WICKED SICK
21 Frags -> MONSTER KILL
23 Frags -> HOLY SHIT
24 Frags -> G O D L I K E

when some kill 2 enemies he or she must get two 2x xp for killing double enemies
Like %s you got 2XP for Doubel kill, %s You Got 3XP For Triple kill so & so..

+ if someone killed him/her theie xp aint get deducted i.e you got 6 xp for knife kill so its, must you lost 6 xp for dying with knife so and so

can anyone help me with this

zmd94 01-31-2016 05:45

Re: Need Help With XP
 
Just add frag count in HamKilled forward.

Shockyboy 01-31-2016 09:38

Re: Need Help With XP
 
Quote:

Originally Posted by zmd94 (Post 2388655)
Just add frag count in HamKilled forward.

Can you help me with the same?

zmd94 02-03-2016 17:59

Re: Need Help With XP
 
PHP Code:

// Global variable
new g_iKillCount[33]

public 
fw_PlayerKilled(iVictimiKiller)  
{
    if (!
is_user_alive(iKiller) || iVictim == iKiller
        return
    
    
has_speed[victim] = false
    remove_task
(victim+TASK_SPEED_BOOST)
    
    
// Increase kill count for killer
    
g_iKillCount[iKiller] ++
    
    
// If kill count equal to two
    
if(g_iKillCount[iKiller] == 2)
    {
        
// Do something
    
}
    
    
// If kill count equal to four
    
if(g_iKillCount[iKiller] == 4)
    {
        
// Do something
    
}



indraraj striker 02-03-2016 23:39

Re: Need Help With XP
 
Or in your code already g_kills is present which is counting kill you can forward this in other function as this is global variable

PHP Code:

count_kills(attackerin EventDeathMsgwpnindex )
next forward this in next function

public 
count_kills(id)
{
    if(
g_kills[id] == 2)
   {
   
//do your stuff like show hudmessage or chat "double kills"
   
}
   if(
g_kills[id] == 3)
   {
    
//do your stuff like show hudmessage or chat "Triple kills"
   
}
   if(
g_kills[id] == 4)
   {
   
//do your stuff like show hudmessage or chat "Rampage kills"
   
}



Craxor 02-04-2016 01:40

Re: Need Help With XP
 
Code:
// Global variable new g_iKillCount[33] public fw_PlayerKilled(iVictim, iKiller)   {     if (!is_user_alive(iKiller) || iVictim == iKiller || !iKiller)         return         //has_speed[victim] = false     //remove_task(victim+TASK_SPEED_BOOST)     has_speed[iVictim] = false     remove_task(iVictim+TASK_SPEED_BOOST)         // Increase kill count for killer     g_iKillCount[iKiller]++     /*     if(g_iKillCount[iKiller] == 2)     {         // Do something     }         // If kill count equal to four     if(g_iKillCount[iKiller] == 4)     {         // Do something     } */     switch( g_iKillCount[iKiller] )     {         case 1:         {             // 1 kills, what to do?         }         case 2:         {             // 2 kills, what to do?         }         case 3:         {             // 3 kills, what to do?         }         case 4:         {             // 4 kills, what to do?         }         default:         {             // no one of this values, what to do?         }     } }


All times are GMT -4. The time now is 09:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.