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

Respawn Team Toucher


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 09-08-2017 , 14:38   Respawn Team Toucher
Reply With Quote #1

I want to execute respawn only for different team can someone help me?

For example : if toucheR team tero touch toucheD team tero get a toucheR respawn

This code respawn all touchers

Code:
#include < amxmodx > 
#include < engine >
#include <hamsandwich> 

new gOldTouch[33][33]
new Float:gDiff = 0.1 
public plugin_init( ) 
{ 
    register_plugin( "touch team", "1.0", "code" ); 
    register_touch("player","player","fn_PlayerTouchPlayer");
} 
public fn_PlayerTouchPlayer(ToucheR_id,ToucheD_id)
{
    if(get_systime() - gOldTouch[ToucheR_id][ToucheD_id] > gDiff || (get_systime() - gOldTouch[ToucheD_id][ToucheR_id] > gDiff))
    {
        gOldTouch[ToucheR_id][ToucheD_id] = get_systime()
        gOldTouch[ToucheD_id][ToucheR_id] = get_systime()
        
        ExecuteHamB(Ham_CS_RoundRespawn, ToucheR_id)
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}

Last edited by Saint Sinner; 09-08-2017 at 14:39.
Saint Sinner is offline
kristi
Senior Member
Join Date: Nov 2016
Old 09-08-2017 , 17:13   Re: Respawn Team Toucher
Reply With Quote #2

Post in requests section
Code:
#include <amxmodx> 
#include <engine>
#include <hamsandwich> 
#include <cstrike>

new gOldTouch[33][33]
new const Float:gDiff = 0.1 
public plugin_init( ) 
{ 
    register_plugin( "touch team", "1.0", "code" ); 
    register_touch("player","player","fn_PlayerTouchPlayer");
} 
public fn_PlayerTouchPlayer(ToucheR_id,ToucheD_id)
{
    if(cs_get_user_team(ToucheR_id) != cs_get_user_team(ToucheD_id))
        return PLUGIN_CONTINUE;

    if(get_systime() - gOldTouch[ToucheR_id][ToucheD_id] > gDiff || (get_systime() - gOldTouch[ToucheD_id][ToucheR_id] > gDiff))
    {
        gOldTouch[ToucheR_id][ToucheD_id] = get_systime()
        gOldTouch[ToucheD_id][ToucheR_id] = get_systime()
        
        ExecuteHamB(Ham_CS_RoundRespawn, ToucheR_id)
    }
    return PLUGIN_CONTINUE
}

Last edited by kristi; 09-10-2017 at 09:21.
kristi is offline
Send a message via Skype™ to kristi
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 09-10-2017 , 07:44   Re: Respawn Team Toucher
Reply With Quote #3

Kristi, use ==
not !=

He wants to respawn players which have different team.
Also
PHP Code:
 new Float:gDiff 0.1 


PHP Code:
new const Float:gDiff 0.1 
Quite logic here, you are only reading it, not changing its value, so it would be better to define it as constant variable.

Last edited by siriusmd99; 09-10-2017 at 08:23.
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 12:22.


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