Raised This Month: $ Target: $400
 0% 

Team add score


Post New Thread Reply   
 
Thread Tools Display Modes
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
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-20-2016 , 16:28   Re: Team add score
Reply With Quote #2

bump!
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-20-2016 , 19:23   Re: Team add score
Reply With Quote #3

set_user_frags(id,get_user_frags(id) + 4) ( +1 by default game ) = 5, so simple
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-21-2016 , 16:54   Re: Team add score
Reply With Quote #4

public player_killed(){
killer = read_data(1)
set_user_frags(killer, get_user_frags(killer) + 4)
}


Fun and amxmodx module , good luck.
siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-21-2016 , 17:13   Re: Team add score
Reply With Quote #5

i do like this for team !

PHP Code:
public player_killed(){

killer read_data(1)
new 
team get_user_team(killer)
if(
team == )
{
    
set_user_frags(killerget_user_frags(killer) + 1)
}
if(
team == )
{
    
set_user_frags(killerget_user_frags(killer) + 4)
}


__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-21-2016 , 19:37   Re: Team add score
Reply With Quote #6

You're a pro scripter man, Want you work for me?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-22-2016 , 03:29   Re: Team add score
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
You're a pro scripter man, Want you work for me?


If I am well Why do I need to help
Just some simple things
I ask if it is a right way or not ?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-22-2016 , 05:51   Re: Team add score
Reply With Quote #8

yes, it's OK but you can do much more simple:

set_user_frags(killer, get_user_frags(killer) + get_user_team(killer) == 2 ? 4 : 1)
siriusmd99 is offline
Reply



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