Raised This Month: $ Target: $400
 0% 

this code is kinda messed up, or is it?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
I am inevitable
Member
Join Date: May 2019
Location: 0xA6DA34
Old 06-27-2019 , 15:50   this code is kinda messed up, or is it?
Reply With Quote #1

PHP Code:
#include <sourcemod>
#include <cstrike>

bool g_bSomething;

public 
void OnMapStart()
{
    
CreateTimer(5.0Timer_Something_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Something(Handle hTimerint iData)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsValidClient(i))
        {
            if (
g_bSomething)
                
CS_SetClientClanTag(i"Hey");
        
            else
                
CS_SetClientClanTag(i"Ho");
        
            
g_bSomething = !g_bSomething;
        }
    }
    
    return 
Plugin_Continue;
}

public 
bool IsValidClient(int iClient)
{
    if (!(
iClient <= MaxClients) || !IsClientConnected(iClient) || !IsClientInGame(iClient) || IsFakeClient(iClient))
        return 
false;
    
    return 
true;

Hi. I'm trying to make the clantags change every five seconds, and it works just fine when I'm by myself on the server, but whenever someone else joins, everyone has different clan tags and its like the plugin has entered the "failstate-mode".
the weird think is that it all again works fine when everyone but one player leaves the server
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311
I am inevitable is offline
 



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 13:20.


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