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

Solved Help with signature call


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 11-01-2016 , 10:57   Help with signature call
Reply With Quote #1

Please, help me with call this signature. How it is necessary to declare and how then call, so i can change its value?

I tried:
Code:
public Action:test2(client, args)
{
	decl String:arg[11];
	GetCmdArg(1, arg, sizeof(arg));
	Handle g_hGameConf = LoadGameConfigFile("test");
	if(g_hGameConf == null)
	{
		SetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
	}
	StartPrepSDKCall(SDKCall_Static);
	PrepSDKCall_SetFromConf(g_hGameConf, SDKConf_Signature, "test");
	Handle sdkCall = EndPrepSDKCall();
	if(sdkCall == null)
	{
		SetFailState("Unable to find the 'test' signature, check the file version!");
	}
	SDKCall(sdkCall, StringToInt(arg));
}
--->>> Server crashed
Help me, please..

Last edited by Accelerator; 11-02-2016 at 11:23.
Accelerator is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 11-01-2016 , 13:14   Re: Help with signature call
Reply With Quote #2

Or how to call this signature?

To clear all data on the transition players.

Last edited by Accelerator; 11-02-2016 at 23:05.
Accelerator is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-01-2016 , 15:52   Re: Help with signature call
Reply With Quote #3

You should at least state which game you're looking at. l4d 1 or 2?
__________________
Peace-Maker is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 11-01-2016 , 23:12   Re: Help with signature call
Reply With Quote #4

L4D2
Accelerator is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-01-2016 , 23:38   Re: Help with signature call
Reply With Quote #5

You should read the wiki on how to call functions.
You're setting up a call to TransitionedPlayerCount(int*, int*, int) without specifying the return type and the parameter types. It might be much easier to just call int CountTransitioningPlayers(void), which gives you the total count of transitioning players in both teams, because it has no parameters you'd have to worry about.
Just need to add
PHP Code:
PrepSDKCall_SetReturnInfo(SDKType_PlainOldDataSDKPass_Plain); 
You can google on how to dump symbols and demangle them from linux shared libraries to know the argument types or use something like this.
__________________
Peace-Maker is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 11-02-2016 , 00:13   Re: Help with signature call
Reply With Quote #6

Big thanks!

Last edited by Accelerator; 11-02-2016 at 11:25.
Accelerator is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 11-02-2016 , 03:10   Re: Help with signature call
Reply With Quote #7

Sorry, server is stable. But value transitioning players does not change by any means. Maybe something is missing?
Command director_print_player_counts:
Code:
1 transitioning survivors
1 connected survivors
0 transitioning infected
0 connected infected
I write:
Code:
sm_test 0 0 0
No result from any numbers..
SDKCall return value = 2, when there is transitioning players. When there is no - SDKCall = 0.

UPD: Solved

Last edited by Accelerator; 11-02-2016 at 08:46.
Accelerator is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-02-2016 , 20:00   Re: Help with signature call
Reply With Quote #8

Those functions you call just get the numbers, you can't change them with this.
__________________
Peace-Maker is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 11-03-2016 , 12:06   Re: Help with signature call
Reply With Quote #9

If you actually want to change the value you should use StoreToAddress
__________________
Benoist3012 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 11-03-2016 , 16:17   Re: Help with signature call
Reply With Quote #10

Quote:
Originally Posted by Benoist3012 View Post
If you actually want to change the value you should use StoreToAddress
Did you have a look at the functions? That won't help here. It's using an array of KeyValues structures to store transitioning players, so you'd need to get a pointer to g_SavedPlayers and iterate that as KV.

@Accelerator74: Please don't blank out your posts or remove important information after your problem was solved. Leave it there for future reference!
__________________
Peace-Maker 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 17:40.


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