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

SetClientOverlay to everyone?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShadowMarioBR
Member
Join Date: Feb 2018
Old 05-06-2018 , 12:47   SetClientOverlay to everyone?
Reply With Quote #1

This is the script (obviously copied from RTD, just as a test): SetClientOverlay(client, "debug/yuv");
What should i replace 'client' with to execute it to everyone on the server?

Last edited by ShadowMarioBR; 05-06-2018 at 12:55.
ShadowMarioBR is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-06-2018 , 14:07   Re: SetClientOverlay to everyone?
Reply With Quote #2

Use a loop to set it for every1
__________________
8guawong is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-06-2018 , 21:48   Re: SetClientOverlay to everyone?
Reply With Quote #3

Just in case if you don't know how to loop through each client:
PHP Code:
for (int i 1<= MaxClientsi++)
{
    if (
IsClientInGame(i))
    {
        
// Insert your code here
    
}


Last edited by ThatKidWhoGames; 05-06-2018 at 21:49.
ThatKidWhoGames is offline
ShadowMarioBR
Member
Join Date: Feb 2018
Old 05-07-2018 , 22:30   Re: SetClientOverlay to everyone?
Reply With Quote #4

How exactly can i set it as an loop to everyone in here? (it's a FF2 boss rage ability)

Quote:
if(!strcmp(ability_name, "rage_nostalgiaoverlay"))
{
SetClientOverlay(client, "debug/yuv");
NostalgiaEnd[client] = CreateTimer(8.0, Timer_NostalgiaEnd, client, TIMER_REPEAT);
}
return Plugin_Continue;
}

public Action Timer_NostalgiaEnd(Handle timer)
{
SetClientOverlay(client, "");
if (NostalgiaEnd[client] != null)
{
KillTimer(NostalgiaEnd[client]);
NostalgiaEnd[client] = null;
}
return Plugin_Continue;
}
ShadowMarioBR is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-08-2018 , 02:03   Re: SetClientOverlay to everyone?
Reply With Quote #5

Quote:
Originally Posted by ShadowMarioBR View Post
How exactly can i set it as an loop to everyone in here? (it's a FF2 boss rage ability)
Can you provide the full code of that function that calls the timer callback? I don't know where "client" is declared. Also, the timer callback's parameters are wrong. It should be "Handle timer, any client" not just "Handle timer" since I don't see anywhere else where "client" is declared inside that timer callback's code block.
__________________
Psyk0tik is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-08-2018 , 07:42   Re: SetClientOverlay to everyone?
Reply With Quote #6

Quote:
Originally Posted by ShadowMarioBR View Post
How exactly can i set it as an loop to everyone in here? (it's a FF2 boss rage ability)
PHP Code:
if (!strcmp(ability_name"rage_nostalgiaoverlay"))
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
SetClientOverlay(i"debug/yuv");
            
NostalgiaEnd[i] = CreateTimer(8.0Timer_NostalgiaEndi);
        }
    }

Also, why did you have it as a repeat timer?

Last edited by ThatKidWhoGames; 05-08-2018 at 07:43.
ThatKidWhoGames 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 02:40.


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