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

Solved [CS GO] Problem with HUD Message !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-20-2018 , 06:14   [CS GO] Problem with HUD Message !
Reply With Quote #1

hi guys,
i need to hud message but dont work.
i used panorama.
my script:
PHP Code:
#include <sourcemod>

public void OnClientPostAdminCheck(int client)
{
    
SetHudTextParams(-1.0, -1.020.025525525525500.00.00.0);
    
ShowHudText(client, -1"Hello World !!");

thank you for any help

Last edited by Dr.Mohammad; 07-25-2018 at 10:02.
Dr.Mohammad is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-20-2018 , 06:27   Re: [CS GO] Problem with HUD Message !
Reply With Quote #2

Don't use OnClientPostAdminCheck, I'll tell you that

Last edited by mug1wara; 07-20-2018 at 06:28.
mug1wara is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-20-2018 , 07:22   Re: [CS GO] Problem with HUD Message !
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
Don't use OnClientPostAdminCheck, I'll tell you that
can you write for me this program ??
Dr.Mohammad is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 07-20-2018 , 07:48   Re: [CS GO] Problem with HUD Message !
Reply With Quote #4

Quote:
Originally Posted by Dr.Mohammad View Post
can you write for me this program ??
PHP Code:
#include <sourcemod> 

#pragma semicolon 1 // Forces the compiler to read only after semicolons (;) [Optional]
#pragma newdecls required // Forces the compiler to read only in new syntax [Optional]

public void OnClientPostAdminCheck(int client) { 
    
CreateTimer(1.0Timer_MessageGetClientUserId(client)); // Pass the client's userid rather than index (for safety)
}  

public 
Action Timer_Message(Handle hTimerany iUser)
{
    
int client GetClientOfUserId(iUser); // Get client's index from userid

    
if (client <= MaxClients && IsClientInGame(client)) // Check if the client between 1 and 65 (valid player indexes). Also check if they're still in game.
    
{
        
SetHudTextParams(-1.0, -1.020.025525525525500.00.00.0); 
        
ShowHudText(client1"Hello World !!"); 
    }

__________________
LenHard is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-20-2018 , 09:37   Re: [CS GO] Problem with HUD Message !
Reply With Quote #5

Quote:
Originally Posted by LenHard View Post
PHP Code:
#include <sourcemod> 

#pragma semicolon 1 // Forces the compiler to read only after semicolons (;) [Optional]
#pragma newdecls required // Forces the compiler to read only in new syntax [Optional]

public void OnClientPostAdminCheck(int client) { 
    
CreateTimer(1.0Timer_MessageGetClientUserId(client)); // Pass the client's userid rather than index (for safety)
}  

public 
Action Timer_Message(Handle hTimerany iUser)
{
    
int client GetClientOfUserId(iUser); // Get client's index from userid

    
if (client <= MaxClients && IsClientInGame(client)) // Check if the client between 1 and 65 (valid player indexes). Also check if they're still in game.
    
{
        
SetHudTextParams(-1.0, -1.020.025525525525500.00.00.0); 
        
ShowHudText(client1"Hello World !!"); 
    }

nice help. thank you

i have a Question:
how can i showing hud message for all time ??
Dr.Mohammad is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-20-2018 , 10:14   Re: [CS GO] Problem with HUD Message !
Reply With Quote #6

Quote:
Originally Posted by Dr.Mohammad View Post
nice help. thank you

i have a Question:
how can i showing hud message for all time ??
i think with TIMER_REPEAT

EDIT:
PHP Code:
CreateTimer(1.0Timer_MessageGetClientUserId(client), TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); 
thanks to SHUFEN.jp

Last edited by iskenderkebab33; 07-20-2018 at 10:52.
iskenderkebab33 is offline
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 07-20-2018 , 10:43   Re: [CS GO] Problem with HUD Message !
Reply With Quote #7

PHP Code:
CreateTimer(1.0Timer_MessageGetClientUserId(client), TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); 

Last edited by SHUFEN; 07-20-2018 at 10:43.
SHUFEN is offline
Send a message via Skype™ to SHUFEN
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-20-2018 , 14:38   Re: [CS GO] Problem with HUD Message !
Reply With Quote #8

Just use OnMapStart, TIMER_FLAG_NO_MAPCHANGE ise useless in this case since OnClientPostAdminCheck isn't triggered yet.
mug1wara is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 07-20-2018 , 17:34   Re: [CS GO] Problem with HUD Message !
Reply With Quote #9

Quote:
Originally Posted by mug1wara View Post
Just use OnMapStart, TIMER_FLAG_NO_MAPCHANGE ise useless in this case since OnClientPostAdminCheck isn't triggered yet.
TIMER_FLAG_NO_MAPCHANGE is a flag to make sure the timer doesn't trigger when the map is changing/changed, I'm assuming for memory leak reasons? Either way, it's just a check and not *useless*
__________________

Last edited by LenHard; 07-20-2018 at 17:35.
LenHard is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-20-2018 , 17:48   Re: [CS GO] Problem with HUD Message !
Reply With Quote #10

https://wiki.alliedmods.net/SourcePa...rs#Timer_Flags
Quote:
Timer Flags

By default, a standard timer doesn't have any flags set. By default, a Data Timer has TIMER_DATA_HNDL_CLOSE set.

The valid flags are the fourth argument to CreateTimer and CreateDataTimer are

TIMER_REPEAT
The timer will be called repeatedly until its handle is closed or the timer callback function returns Plugin_Stop

TIMER_FLAG_NO_MAPCHANGE
The timer will automatically stop if the map changes

TIMER_DATA_HNDL_CLOSE
Automatically close the Handle when the Timer ends. This is the default for CreateDataTimer.
Maxximou5 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 01:00.


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