Raised This Month: $ Target: $400
 0% 

Team add score


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-18-2016 , 16:45   Team add score
Reply With Quote #1

Hi !
i want change score frag value (1 to 5 ) evry team T & CT

i try this do like that ... no thing ...who can give me correct code to do it ?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>


new g_iTeam[33];
new 
MaxPlayers;

enum
{
    
CS_TEAM_T 1,
    
CS_TEAM_CT 2,
    
CS_TEAM_SPECTATOR 3
};

public 
plugin_init() {
    
    
register_event("DeathMsg""player_killed""a")
    
MaxPlayers get_maxplayers();
}

public 
player_killed()
{
    new 
CTiGift 5
    
new TiGift 2
    
    
new iKiller read_data(1)
    new 
id read_data(2)
    
    new 
tid get_user_team(iKiller)
    
    switch(
tid)
    {
        case 
1g_iTeam[iKiller] = CS_TEAM_T;
        case 
2g_iTeam[iKiller] = CS_TEAM_CT;
        default: return;
    }
    
    if(
<= iKiller <= MaxPlayers)
    {
        
        if(
get_user_team(id) == tid)
        {
            if(
tid == CS_TEAM_T 
            { 
                
player_setScore(tidTiGift)
            } 
            if(
tid == CS_TEAM_CT 
            { 
                
player_setScore(tidCTiGift)
            } 
        }
    }



player_setScore(idiAddFrags)
{
    new 
iFrags get_user_frags(id)
    new 
iDeaths get_user_deaths(id)
    
    new 
tid get_user_team(id)
    
    if(
iAddFrags != 0)
    {
        
iFrags += iAddFrags
        set_user_frags
(idiFrags)
    }
    
message_begin(MSG_BROADCASTget_user_msgid("TeamScore"))
    
write_byte(id)
    
write_short(iFrags)
    
write_short(iDeaths)
    
write_short(0)
    
write_short(tid)
    
message_end()
    
    

__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:36.


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