Raised This Month: $32 Target: $400
 8% 

cs_get_user_team HELP!!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BloodyNuker
Member
Join Date: Jan 2006
Old 07-02-2006 , 20:36   cs_get_user_team HELP!!!!
Reply With Quote #1

Hello, i donīt know why when attacker is a Terror the Counter donīt slaped

I canīt show if the victim are a CT or a Terror
Code:
public Event_Damage(id) {     new damage = read_data(2);     new victim = read_data(0);     new attacker = get_user_attacker(victim) cs_set_user_team(victim,CS_TEAM_T) cs_set_user_team(attacker,CS_TEAM_CT) set_user_health(attacker, 999) set_user_health(victim, 999) cs_set_user_armor (attacker, 999, CsArmorType:2) cs_set_user_armor (victim, 999, CsArmorType:2)             new newFrags = get_user_frags(victim) - 1             set_user_frags(victim,newFrags) if(cs_get_user_team(victim) == CS_TEAM_CT) { user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) }    return PLUGIN_CONTINUE }


Tnkz if can help me!!!!
BloodyNuker is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-02-2006 , 20:44   Re: cs_get_user_team HELP!!!!
Reply With Quote #2

You don't need all that, try this:

Code:
public Event_Damage(id) {          new victim = read_data(1),attacker = get_user_attacker(victim)     if(attacker && cs_get_user_team(victim) == CS_TEAM_CT && cs_get_user_team(attacker) == CS_TEAM_CT)         for(new iCount;iCount < 8;iCount++)             user_slap(victim,0) }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
BloodyNuker
Member
Join Date: Jan 2006
Old 07-02-2006 , 21:16   Re: cs_get_user_team HELP!!!!
Reply With Quote #3

Quote:
Originally Posted by Hawk552
You don't need all that, try this:
Yes i need because the plugin is this:

The Terrorist is ONE and the other players are CTS, the CTS must run because the terrorist if attack the CT convert in terrorist and the terrorist in CT. This is the plugin script:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun> new ctnum, ct[32], tnum, t[32] public plugin_init() {    register_plugin("Mancha","1.0.0","lol")    register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" );    register_event("ResetHUD", "sp_on", "be")    return PLUGIN_CONTINUE } public client_putinserver(id) { set_task(1.0, "client_verificacion1", id, "b") } public client_verificacion1(id) { if( !is_user_connected(id) ) { return PLUGIN_HANDLED; } client_print(0,print_chat,"[MANCHA] El terrorista es la MANCHA, los CTS CORRAN!!!") cs_set_user_money(id, 0,1) strip_user_weapons(id); give_item(id, "weapon_knife") get_players(t, tnum, "eg", "TERRORIST") get_players(ct, ctnum, "eg", "CT") if(tnum == 1) {         } else { cs_set_user_team(id,CS_TEAM_CT) } if(tnum == 0) { cs_set_user_team(id,CS_TEAM_T)    } cs_set_user_money(id, 0,1) cs_set_user_armor (id, 999, CsArmorType:2) set_user_health(id, 999) cs_set_weapon_ammo(id, 0) return PLUGIN_CONTINUE } public Event_Damage(id) {          new victim = read_data(1),attacker = get_user_attacker(victim)     if(attacker && cs_get_user_team(victim) == CS_TEAM_CT && cs_get_user_team(attacker) == CS_TEAM_CT)         for(new iCount;iCount < 8;iCount++)             user_slap(victim,0) cs_set_user_team(victim,CS_TEAM_T) cs_set_user_team(attacker,CS_TEAM_CT) set_user_health(attacker, 999) set_user_health(victim, 999) cs_set_user_armor (attacker, 999, CsArmorType:2) cs_set_user_armor (victim, 999, CsArmorType:2)             new newFrags = get_user_frags(victim) - 1             set_user_frags(victim,newFrags)    return PLUGIN_CONTINUE } public sp_on(id) {       set_task(0.1, "client_verificacion1", id, "b")    return PLUGIN_CONTINUE }

But i donīt know why when a Trrorist attack a CT, the CT donīt slaped

Plz help!
BloodyNuker is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-02-2006 , 21:27   Re: cs_get_user_team HELP!!!!
Reply With Quote #4

You make absolutely no sense, and neither does your plugin. Can you please explain with English that isn't totally broken and without ending everything you say with "plz help"?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
BloodyNuker
Member
Join Date: Jan 2006
Old 07-02-2006 , 21:50   Re: cs_get_user_team HELP!!!!
Reply With Quote #5

In spanish the game name is MANCHA but in english i donīt know, i search and probably spot is called, hawk.. sorry mi english ;)

I donīt say plz do my a plugin... :/
I ask why in event_damage i canīt show the player team, and i test your help and donīt work :ī(

The plugin do thease:

The terrorist persecute the counter-terrorist

When a terrorist attack a counter-terrorist the healt recover because i need doesnīt die.

The terrorist transfered to Counter terrorist and the Counter-Terrorist transfered to Terrorist.

All that I said works perfect

The problem is here...

If the attacker is a terrorist it has to be slaped the Counter-terrorist

Why my first example donīt work good?

I post the plugin completly

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun> new ctnum, ct[32], tnum, t[32] public plugin_init() {    register_plugin("Mancha","1.0.0","lol")    register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" );    register_event("ResetHUD", "sp_on", "be")    return PLUGIN_CONTINUE } public client_putinserver(id) { set_task(1.0, "client_verificacion1", id, "b") } public client_verificacion1(id) { if( !is_user_connected(id) ) { return PLUGIN_HANDLED; } client_print(0,print_chat,"[MANCHA] El terrorista es la MANCHA, los CTS CORRAN!!!") cs_set_user_money(id, 0,1) strip_user_weapons(id); give_item(id, "weapon_knife") get_players(t, tnum, "eg", "TERRORIST") get_players(ct, ctnum, "eg", "CT") if(tnum == 1) {         } else { cs_set_user_team(id,CS_TEAM_CT) } if(tnum == 0) { cs_set_user_team(id,CS_TEAM_T)    } cs_set_user_money(id, 0,1) cs_set_user_armor (id, 999, CsArmorType:2) set_user_health(id, 999) cs_set_weapon_ammo(id, 0) return PLUGIN_CONTINUE } public Event_Damage() {     new damage = read_data(2);     new victim = read_data(0);     new attacker = get_user_attacker(victim) cs_set_user_team(victim,CS_TEAM_T) cs_set_user_team(attacker,CS_TEAM_CT) set_user_health(attacker, 999) set_user_health(victim, 999) cs_set_user_armor (attacker, 999, CsArmorType:2) cs_set_user_armor (victim, 999, CsArmorType:2)             new newFrags = get_user_frags(victim) - 1             set_user_frags(victim,newFrags) if(cs_get_user_team(victim) == CS_TEAM_CT) { user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) }    return PLUGIN_CONTINUE } public sp_on(id) {       set_task(0.1, "client_verificacion1", id, "b")    return PLUGIN_CONTINUE }


Show... this is the problem :@

Code:
if(cs_get_user_team(victim) == CS_TEAM_CT) { user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) }

If somebody can help welcome it is.
Sorry hawk if I made you anger
BloodyNuker is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-02-2006 , 22:45   Re: cs_get_user_team HELP!!!!
Reply With Quote #6

You're problem is simple

Code:
#cs_set_user_team(victim,CS_TEAM_T) cs_set_user_team(attacker,CS_TEAM_CT) set_user_health(attacker, 999) set_user_health(victim, 999) cs_set_user_armor (attacker, 999, CsArmorType:2) cs_set_user_armor (victim, 999, CsArmorType:2)             new newFrags = get_user_frags(victim) - 1             set_user_frags(victim,newFrags) #if(cs_get_user_team(victim) == CS_TEAM_CT) { user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) }

You set their team to T then check if its CT so it would never happen.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-03-2006 , 01:17   Re: cs_get_user_team HELP!!!!
Reply With Quote #7

Bloody, your code is giving me a headache.
Code:
public Event_Damage(id) {     new victim = id     if(!is_user_alive(victim))         return PLUGIN_CONTINUE     new attacker = get_user_attacker(victim)     if(!is_user_alive(attacker))         return PLUGIN_CONTINUE     //new damage = read_data(2)     cs_set_user_team(victim, CS_TEAM_T)     cs_set_user_team(attacker, CS_TEAM_CT)     set_user_health(attacker, 999)     set_user_health(victim, 999)     cs_set_user_armor(attacker, 999, CsArmorType:2)     cs_set_user_armor(victim, 999, CsArmorType:2)     new newFrags = get_user_frags(victim) - 1     set_user_frags(victim,newFrags)     new CsTeams:VicTeam = cs_get_user_team(victim)     if(VicTeam == CS_TEAM_CT)     {         for(new i = 1; i <= 10; i++)             user_slap(victim, 0)     }     return PLUGIN_CONTINUE }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
BloodyNuker
Member
Join Date: Jan 2006
Old 07-03-2006 , 09:10   Re: cs_get_user_team HELP!!!!
Reply With Quote #8

I cannot stop to laugh
Quote:
Originally Posted by v3x
Bloody, your code is giving me a headache.
Thank you very much by the answers but I couldnīt make work it

Suicid3:
This is the plugin you say me...
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun> new ctnum, ct[32], tnum, t[32] public plugin_init() {    register_plugin("Mancha","1.0.0","lol")    register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" );    register_event("ResetHUD", "sp_on", "be")    return PLUGIN_CONTINUE } public client_putinserver(id) { set_task(1.0, "client_verificacion1", id, "b") } public client_verificacion1(id) { if( !is_user_connected(id) ) { return PLUGIN_HANDLED; } client_print(0,print_chat,"[MANCHA] El terrorista es la MANCHA, los CTS CORRAN!!!") cs_set_user_money(id, 0,1) strip_user_weapons(id); give_item(id, "weapon_knife") get_players(t, tnum, "eg", "TERRORIST") get_players(ct, ctnum, "eg", "CT") if(tnum == 1) {         } else { cs_set_user_team(id,CS_TEAM_CT) } if(tnum == 0) { cs_set_user_team(id,CS_TEAM_T)    } cs_set_user_money(id, 0,1) cs_set_user_armor (id, 999, CsArmorType:2) set_user_health(id, 999) cs_set_weapon_ammo(id, 0) return PLUGIN_CONTINUE } public Event_Damage(id) {     new victim = id     if(!is_user_alive(victim))         return PLUGIN_CONTINUE     new attacker = get_user_attacker(victim)     //new damage = read_data(2) #cs_set_user_team(victim,CS_TEAM_T) cs_set_user_team(attacker,CS_TEAM_CT) set_user_health(attacker, 999) set_user_health(victim, 999) cs_set_user_armor (attacker, 999, CsArmorType:2) cs_set_user_armor (victim, 999, CsArmorType:2)             new newFrags = get_user_frags(victim) - 1             set_user_frags(victim,newFrags) #if(cs_get_user_team(victim) == CS_TEAM_CT) { user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) user_slap(victim, 0) } #endif return PLUGIN_CONTINUE } public sp_on(id) {       set_task(0.1, "client_verificacion1", id, "b")    return PLUGIN_CONTINUE }

and when I compile it says this

Code:
/home/groups/amxmodx/tmp3/textYFlcZC.sma(65) : error 031: unknown directive
/home/groups/amxmodx/tmp3/textYFlcZC.sma(65) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/textYFlcZC.sma(73) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textYFlcZC.sma(76) : error 008: must be a constant expression; assumed zero
/home/groups/amxmodx/tmp3/textYFlcZC.sma(96) : warning 217: loose indentation
And V3x i can compile your solution but when a Terrorist attack a Counter-Terrorist the CT donīt SLAPED..

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> #include <fun> new ctnum, ct[32], tnum, t[32] public plugin_init() {    register_plugin("Mancha","1.0.0","lol")    register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" );    register_event("ResetHUD", "sp_on", "be")    return PLUGIN_CONTINUE } public client_putinserver(id) { set_task(1.0, "client_verificacion1", id, "b") } public client_verificacion1(id) { if( !is_user_connected(id) ) { return PLUGIN_HANDLED; } client_print(0,print_chat,"[MANCHA] El terrorista es la MANCHA, los CTS CORRAN!!!") cs_set_user_money(id, 0,1) strip_user_weapons(id); give_item(id, "weapon_knife") get_players(t, tnum, "eg", "TERRORIST") get_players(ct, ctnum, "eg", "CT") if(tnum == 1) {         } else { cs_set_user_team(id,CS_TEAM_CT) } if(tnum == 0) { cs_set_user_team(id,CS_TEAM_T)    } cs_set_user_money(id, 0,1) cs_set_user_armor (id, 999, CsArmorType:2) set_user_health(id, 999) cs_set_weapon_ammo(id, 0) return PLUGIN_CONTINUE } public Event_Damage(id) {     new victim = id     if(!is_user_alive(victim))         return PLUGIN_CONTINUE     new attacker = get_user_attacker(victim)     if(!is_user_alive(attacker))         return PLUGIN_CONTINUE     //new damage = read_data(2)     cs_set_user_team(victim, CS_TEAM_T)     cs_set_user_team(attacker, CS_TEAM_CT)     set_user_health(attacker, 999)     set_user_health(victim, 999)     cs_set_user_armor(attacker, 999, CsArmorType:2)     cs_set_user_armor(victim, 999, CsArmorType:2)     new newFrags = get_user_frags(victim) - 1     set_user_frags(victim,newFrags)     new CsTeams:VicTeam = cs_get_user_team(victim)     if(VicTeam == CS_TEAM_CT)     {         for(new i = 1; i <= 10; i++)             user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)         user_slap(victim, 0)     }     return PLUGIN_CONTINUE } public sp_on(id) {       set_task(0.1, "client_verificacion1", id, "b")    return PLUGIN_CONTINUE }


Thanks for the answers
BloodyNuker is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-03-2006 , 09:30   Re: cs_get_user_team HELP!!!!
Reply With Quote #9

The CT (victim) isn't getting slapped because you set his team to CS_TEAM_T.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 07-03-2006 , 10:27   Re: cs_get_user_team HELP!!!!
Reply With Quote #10

I wasn't giving you code bloodynucker I was highlighting your problem code.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 19:46.


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