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

GetClientFrags returning empty


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
addemod
Junior Member
Join Date: Feb 2016
Old 02-09-2016 , 14:43   GetClientFrags returning empty
Reply With Quote #1

Hello. I am trying to get the frags the player has.
It's for a CS:S plugin.

The code currently looks like this:
Code:
#include <sourcemod>

public Plugin:myinfo = {
	name 			= "Test",
	author 			= "Addemod",
	description		= "Test",
	url			= ""
};

public OnPluginStart()
{
	HookEvent("player_jump", Event_PlayerJump, EventHookMode_Pre);
}

public Action Event_PlayerJump(Event event, const char[] name, bool:dontBroadcast)
{
	int client = GetClientOfUserId(event.GetInt("userid"));
	PrintToChat(client, "You currently have %s kills.", GetClientDeaths(client));
	return Plugin_Handled;
}
It prints to the chat, but with the %s empty. It looks like "You currently have kills.".

Any idea??

Reference: https://sm.alliedmods.net/new-api/cl...GetClientFrags

Last edited by addemod; 02-09-2016 at 14:43.
addemod is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 02-09-2016 , 15:15   Re: GetClientFrags returning empty
Reply With Quote #2

%d, not %s
Miu is offline
addemod
Junior Member
Join Date: Feb 2016
Old 02-09-2016 , 16:04   Re: GetClientFrags returning empty
Reply With Quote #3

Quote:
Originally Posted by Miu View Post
%d, not %s
Oh, right.

Would you mind explain why? I'm not familiar with string formatting.
addemod is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 02-09-2016 , 16:09   Re: GetClientFrags returning empty
Reply With Quote #4

Quote:
Originally Posted by addemod View Post
Oh, right.

Would you mind explain why? I'm not familiar with string formatting.
https://wiki.alliedmods.net/Format_C...eMod_Scripting)
Darkness_ is offline
addemod
Junior Member
Join Date: Feb 2016
Old 02-09-2016 , 16:22   Re: GetClientFrags returning empty
Reply With Quote #5

Quote:
Originally Posted by Darkness_ View Post
Thanks. That exlains it!
addemod 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 19:08.


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