Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "DispatchKeyValueInt" stock #1764

Merged
merged 3 commits into from
May 6, 2022
Merged

Conversation

Psykotikism
Copy link
Contributor

Closes #1761

@Mart-User
Copy link
Contributor

Thank you! I hope it merges.

@Wend4r
Copy link
Contributor

Wend4r commented May 6, 2022

I suggest adding 2 more stock functions by Vector and float as in the games code

bool CBaseEntity::KeyValue( const char *szKeyName, float flValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%f", flValue );

	return KeyValue( szKeyName, string );
}

bool CBaseEntity::KeyValue( const char *szKeyName, int nValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%d", nValue );

	return KeyValue( szKeyName, string );
}

bool CBaseEntity::KeyValue( const char *szKeyName, const Vector &vecValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%f %f %f", vecValue.x, vecValue.y, vecValue.z );

	return KeyValue( szKeyName, string );
}

Copy link
Member

@asherkin asherkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

plugins/include/sdktools_functions.inc Outdated Show resolved Hide resolved
@asherkin asherkin merged commit 7a3d4e7 into alliedmodders:master May 6, 2022
@Psykotikism Psykotikism deleted the patch-1 branch May 6, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: DispatchKeyValueInt
4 participants