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

Solved Name of client in PrintHintTextToAll


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 11-26-2017 , 08:42   Name of client in PrintHintTextToAll
Reply With Quote #1

Hey coders,

i dont know how i can make client in text (how to loop him).
like:

PrintHintTextToAll("*Here will be name of the client* want heal!")

And if you know how i can set delay on this, i will be happy if you tell me how i can make it..

Thanks..

Last edited by Javierko; 11-26-2017 at 14:35. Reason: solved
Javierko is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-26-2017 , 08:53   Re: Name of client in PrintHintTextToAll
Reply With Quote #2

Code:
char clientname[256];
GetClientName(client, clientname, 256);
PrintHintTextToAll("%s want heal!", clientname);

Last edited by Facksy; 11-26-2017 at 08:53.
Facksy is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 11-26-2017 , 09:01   Re: Name of client in PrintHintTextToAll
Reply With Quote #3

Thanks man, and do you know how i can set delay for player? 30 seconds...?
Javierko is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-26-2017 , 09:15   Re: Name of client in PrintHintTextToAll
Reply With Quote #4

PHP Code:
//stuff
{
    
CreateTimer(30.0PrintHintclient);
}

public 
Action:PrintHint(Handle Timerany client)
{
    
char clientname[256];
    
GetClientName(clientclientname256);
    
PrintHintTextToAll("%s want heal!"clientname);

Should work

Last edited by Facksy; 11-26-2017 at 09:16.
Facksy is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 11-26-2017 , 09:32   Re: Name of client in PrintHintTextToAll
Reply With Quote #5

Some way to add it into menu?
Javierko is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-26-2017 , 09:46   Re: Name of client in PrintHintTextToAll
Reply With Quote #6

Instead of doing it part by part, tell me what do you want exactly, it will be faster ;)

Last edited by Facksy; 11-26-2017 at 09:46.
Facksy is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 11-26-2017 , 09:50   Re: Name of client in PrintHintTextToAll
Reply With Quote #7

Menu
1. Request Heal

Click on it

it will make printhinttoall and it will make delay for the player who clicked on it..
Javierko is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-26-2017 , 10:19   Re: Name of client in PrintHintTextToAll
Reply With Quote #8

Code:
{
    new Handle:menu = CreateMenu(Menu_Handler);
	SetMenuTitle(menu "Title");
	AddMenuItem(menu, "1", "Request Heal");
	SetMenuExitButton(menu, true);
	DisplayMenu(menu, client, 60);
}

public Menu_Handler(Handle:menu, MenuAction:action, client, param2)
{	
	if(action == MenuAction_End)
	{
		CloseHandle(menu);
	}
	if(action == MenuAction_Select)
	{
		decl String:info[12];	
		GetMenuItem(menu, param2, info, sizeof(info));	
			
		if(StrEqual(info, "1"))
		{
			CreateTimer(30.0, PrintHint, client);
		}
	}
}

public Action:PrintHint(Handle Timer, any client)
{
    char clientname[256];
    GetClientName(client, clientname, 256);
    PrintHintTextToAll("%s want heal!", clientname);
}
Facksy is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 11-26-2017 , 11:31   Re: Name of client in PrintHintTextToAll
Reply With Quote #9

When i click on it, it will make timer on 30 second and after this 30 seconds it will print into hint.

But i want it like this..

When i click on it, it will auto. print it, but when i click again on it, it will make delay 30 seconds, and after this 30 seconds i can click again and it will print into hint..

Somebody knows?
Javierko is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 11-26-2017 , 12:10   Re: Name of client in PrintHintTextToAll
Reply With Quote #10

there is no need for GetClientName. You can just use %N for nickname

PHP Code:
PrintHintTextToAll("%N want heal!"client); 
__________________
coding & free software
shanapu 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 13:35.


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