Raised This Month: $12 Target: $400
 3% 

[REQ] Is it possible to set flags to this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ApoziX
Member
Join Date: Sep 2018
Old 09-22-2018 , 08:33   [REQ] Is it possible to set flags to this?
Reply With Quote #1

Is it possible to set it to work only on flag "T""

PHP Code:
#include <sourcemod>
#include <tf2>
#define PLUGIN_VERSION "1.4"

new bool:ToggleTags true;
public 
Plugin:myinfo 
{
    
name "Instant Respawn",
    
author "ChauffeR",
    
version PLUGIN_VERSION,
    
url "http://hop.tf"
}

public 
OnPluginStart()
{
    
CreateConVar("sm_tf2_instantrespawn"PLUGIN_VERSION"Plugin Version of [TF2] Instant Respawn"FCVAR_PLUGIN FCVAR_SPONLY FCVAR_NOTIFY FCVAR_REPLICATED FCVAR_DONTRECORD);
    
HookEvent("player_death"OnPlayerDeath);
    
    if(
TagsContain("norespawntime"))
    {
        
ToggleTags false;
    }
    
TagsCheck("norespawntime");
}

public 
OnPluginEnd()
{
    if(
ToggleTags == true)
    {
        
TagsCheck("norespawntime"true);
    }
}

public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
RequestFrame(RespawnGetClientSerial(client));
}

public 
Respawn(any:serial)
{
    new 
client GetClientFromSerial(serial);
    if(
client != 0)
    {
        new 
team GetClientTeam(client);
        if(!
IsPlayerAlive(client) && team != 1)
        {
            
TF2_RespawnPlayer(client);
        }
    }
}

public 
bool:TagsContain(const String:tag[])
{
    new 
Handle:hTags FindConVar("sv_tags");
    
decl String:tags[255];
    
GetConVarString(hTagstagssizeof(tags));
    if(
StrContains(tagstag) > -1)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }
}

/*
Stock from WoZeR's code
*/

stock TagsCheck(const String:tag[], bool:remove false)
{
    new 
Handle:hTags FindConVar("sv_tags");
    
decl String:tags[255];
    
GetConVarString(hTagstagssizeof(tags));

    if (
StrContains(tagstagfalse) == -&& !remove)
    {
        
decl String:newTags[255];
        
Format(newTagssizeof(newTags), "%s,%s"tagstag);
        
ReplaceString(newTagssizeof(newTags), ",,"","false);
        
SetConVarString(hTagsnewTags);
        
GetConVarString(hTagstagssizeof(tags));
    }
    else if (
StrContains(tagstagfalse) > -&& remove)
    {
        
ReplaceString(tagssizeof(tags), tag""false);
        
ReplaceString(tagssizeof(tags), ",,"","false);
        
SetConVarString(hTagstags);
    }

Thanks For Helpers +rep!!
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-22-2018 , 09:04   Re: [REQ] Is it possible to set flags to this?
Reply With Quote #2

PHP Code:
#include <sourcemod> 
#include <tf2> 
#define PLUGIN_VERSION "1.4" 

new bool:ToggleTags true
public 
Plugin:myinfo =  

    
name "Instant Respawn"
    
author "ChauffeR"
    
version PLUGIN_VERSION
    
url "http://hop.tf" 


public 
OnPluginStart() 

    
CreateConVar("sm_tf2_instantrespawn"PLUGIN_VERSION"Plugin Version of [TF2] Instant Respawn"FCVAR_PLUGIN FCVAR_SPONLY FCVAR_NOTIFY FCVAR_REPLICATED FCVAR_DONTRECORD); 
    
HookEvent("player_death"OnPlayerDeath); 
     
    if(
TagsContain("norespawntime")) 
    { 
        
ToggleTags false
    } 
    
TagsCheck("norespawntime"); 


public 
OnPluginEnd() 

    if(
ToggleTags == true
    { 
        
TagsCheck("norespawntime"true); 
    } 


public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast

    new 
client GetClientOfUserId(GetEventInt(event"userid")); 
    
RequestFrame(RespawnGetClientSerial(client)); 


public 
Respawn(any:serial

    new 
client GetClientFromSerial(serial); 
    if(
client != 0
    { 
        new 
team GetClientTeam(client); 
        if(!
IsPlayerAlive(client) && team != && CheckCommandAccess(client"sm_admin"ADMFLAG_CUSTOM6))
        { 
            
TF2_RespawnPlayer(client); 
        } 
    } 


public 
bool:TagsContain(const String:tag[]) 

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 
    if(
StrContains(tagstag) > -1
    { 
        return 
true
    } 
    else 
    { 
        return 
false
    } 


/* 
Stock from WoZeR's code 
*/ 

stock TagsCheck(const String:tag[], bool:remove false

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 

    if (
StrContains(tagstagfalse) == -&& !remove
    { 
        
decl String:newTags[255]; 
        
Format(newTagssizeof(newTags), "%s,%s"tagstag); 
        
ReplaceString(newTagssizeof(newTags), ",,"","false); 
        
SetConVarString(hTagsnewTags); 
        
GetConVarString(hTagstagssizeof(tags)); 
    } 
    else if (
StrContains(tagstagfalse) > -&& remove
    { 
        
ReplaceString(tagssizeof(tags), tag""false); 
        
ReplaceString(tagssizeof(tags), ",,"","false); 
        
SetConVarString(hTagstags); 
    } 

Wrote from mobile, there can be a mistake
__________________
Taking paid private requests! Contact me
Cruze is offline
ApoziX
Member
Join Date: Sep 2018
Old 09-22-2018 , 09:06   Re: [REQ] Is it possible to set flags to this?
Reply With Quote #3

Quote:
Originally Posted by Cruze View Post
PHP Code:
#include <sourcemod> 
#include <tf2> 
#define PLUGIN_VERSION "1.4" 

new bool:ToggleTags true
public 
Plugin:myinfo =  

    
name "Instant Respawn"
    
author "ChauffeR"
    
version PLUGIN_VERSION
    
url "http://hop.tf" 


public 
OnPluginStart() 

    
CreateConVar("sm_tf2_instantrespawn"PLUGIN_VERSION"Plugin Version of [TF2] Instant Respawn"FCVAR_PLUGIN FCVAR_SPONLY FCVAR_NOTIFY FCVAR_REPLICATED FCVAR_DONTRECORD); 
    
HookEvent("player_death"OnPlayerDeath); 
     
    if(
TagsContain("norespawntime")) 
    { 
        
ToggleTags false
    } 
    
TagsCheck("norespawntime"); 


public 
OnPluginEnd() 

    if(
ToggleTags == true
    { 
        
TagsCheck("norespawntime"true); 
    } 


public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast

    new 
client GetClientOfUserId(GetEventInt(event"userid")); 
    
RequestFrame(RespawnGetClientSerial(client)); 


public 
Respawn(any:serial

    new 
client GetClientFromSerial(serial); 
    if(
client != 0
    { 
        new 
team GetClientTeam(client); 
        if(!
IsPlayerAlive(client) && team != && CheckCommandAccess(client"sm_admin"ADMFLAG_CUSTOM6))
        { 
            
TF2_RespawnPlayer(client); 
        } 
    } 


public 
bool:TagsContain(const String:tag[]) 

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 
    if(
StrContains(tagstag) > -1
    { 
        return 
true
    } 
    else 
    { 
        return 
false
    } 


/* 
Stock from WoZeR's code 
*/ 

stock TagsCheck(const String:tag[], bool:remove false

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 

    if (
StrContains(tagstagfalse) == -&& !remove
    { 
        
decl String:newTags[255]; 
        
Format(newTagssizeof(newTags), "%s,%s"tagstag); 
        
ReplaceString(newTagssizeof(newTags), ",,"","false); 
        
SetConVarString(hTagsnewTags); 
        
GetConVarString(hTagstagssizeof(tags)); 
    } 
    else if (
StrContains(tagstagfalse) > -&& remove
    { 
        
ReplaceString(tagssizeof(tags), tag""false); 
        
ReplaceString(tagssizeof(tags), ",,"","false); 
        
SetConVarString(hTagstags); 
    } 

Wrote from mobile, there can be a mistake
Going to test it
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
ApoziX
Member
Join Date: Sep 2018
Old 09-22-2018 , 09:11   Re: [REQ] Is it possible to set flags to this?
Reply With Quote #4

Quote:
Originally Posted by Cruze View Post
PHP Code:
#include <sourcemod> 
#include <tf2> 
#define PLUGIN_VERSION "1.4" 

new bool:ToggleTags true
public 
Plugin:myinfo =  

    
name "Instant Respawn"
    
author "ChauffeR"
    
version PLUGIN_VERSION
    
url "http://hop.tf" 


public 
OnPluginStart() 

    
CreateConVar("sm_tf2_instantrespawn"PLUGIN_VERSION"Plugin Version of [TF2] Instant Respawn"FCVAR_PLUGIN FCVAR_SPONLY FCVAR_NOTIFY FCVAR_REPLICATED FCVAR_DONTRECORD); 
    
HookEvent("player_death"OnPlayerDeath); 
     
    if(
TagsContain("norespawntime")) 
    { 
        
ToggleTags false
    } 
    
TagsCheck("norespawntime"); 


public 
OnPluginEnd() 

    if(
ToggleTags == true
    { 
        
TagsCheck("norespawntime"true); 
    } 


public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast

    new 
client GetClientOfUserId(GetEventInt(event"userid")); 
    
RequestFrame(RespawnGetClientSerial(client)); 


public 
Respawn(any:serial

    new 
client GetClientFromSerial(serial); 
    if(
client != 0
    { 
        new 
team GetClientTeam(client); 
        if(!
IsPlayerAlive(client) && team != && CheckCommandAccess(client"sm_admin"ADMFLAG_CUSTOM6))
        { 
            
TF2_RespawnPlayer(client); 
        } 
    } 


public 
bool:TagsContain(const String:tag[]) 

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 
    if(
StrContains(tagstag) > -1
    { 
        return 
true
    } 
    else 
    { 
        return 
false
    } 


/* 
Stock from WoZeR's code 
*/ 

stock TagsCheck(const String:tag[], bool:remove false

    new 
Handle:hTags FindConVar("sv_tags"); 
    
decl String:tags[255]; 
    
GetConVarString(hTagstagssizeof(tags)); 

    if (
StrContains(tagstagfalse) == -&& !remove
    { 
        
decl String:newTags[255]; 
        
Format(newTagssizeof(newTags), "%s,%s"tagstag); 
        
ReplaceString(newTagssizeof(newTags), ",,"","false); 
        
SetConVarString(hTagsnewTags); 
        
GetConVarString(hTagstagssizeof(tags)); 
    } 
    else if (
StrContains(tagstagfalse) > -&& remove
    { 
        
ReplaceString(tagssizeof(tags), tag""false); 
        
ReplaceString(tagssizeof(tags), ",,"","false); 
        
SetConVarString(hTagstags); 
    } 

Wrote from mobile, there can be a mistake
Thank you very much no mistakes +rep
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-22-2018 , 12:27   Re: [REQ] Is it possible to set flags to this?
Reply With Quote #5

Quote:
Originally Posted by ApoziX View Post
Thank you very much no mistakes +rep
No problem!
__________________
Taking paid private requests! Contact me
Cruze is offline
Reply


Thread Tools
Display Modes

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 09:19.


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