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

I need help SDKCall using


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ys24ys
Junior Member
Join Date: Nov 2013
Old 09-02-2015 , 01:12   I need help SDKCall using
Reply With Quote #1

Hello!
First, I apologize for my low English proficiency levels.
I need your help.
But I worry about this problem for three days, I could not find a solution.
I would like to use the following API in the codename CURE.
 native bool:AcceptEntityInput(dest, const String:input[], activator=-1, caller=-1, outputid=0);
I found a signature value for the API function below.
 CBaseEntity::AcceptInput(char const*, CBaseEntity*, CBaseEntity*, variant_t, int)
I created the source as follows:

Code:
stock CAcceptEntityInput(dest, const String:input[], activator, caller, outputid 
= 0)
{
 if(g_hSDKCall_AcceptEntityInput == 
INVALID_HANDLE)
 {
  StartPrepSDKCall(SDKCall_Entity);
  PrepSDKCall_SetSignature(SDKLibrary_Server, 
"\x55\x8B\xEC\x81\xEC\x4C\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\x2A\x89\x2A\x2A\x8B", 
20);
  PrepSDKCall_AddParameter(SDKType_String, 
SDKPass_Pointer);
  PrepSDKCall_AddParameter(SDKType_CBaseEntity, 
SDKPass_Pointer);
  PrepSDKCall_AddParameter(SDKType_CBaseEntity, 
SDKPass_Pointer);
  PrepSDKCall_AddParameter(SDKType_CBaseEntity, 
SDKPass_Pointer);
  PrepSDKCall_AddParameter(SDKType_PlainOldData, 
SDKPass_Plain);
  PrepSDKCall_SetReturnInfo(SDKType_Bool, 
SDKPass_Plain);
  if((g_hSDKCall_AcceptEntityInput = 
EndPrepSDKCall()) == 
INVALID_HANDLE)
  {
   LogError("g_hSDKCall_AcceptEntityInput 
Signature Call 
Failed.");
  }
 }
 
 if(g_hSDKCall_AcceptEntityInput 
!= INVALID_HANDLE)
 {
  new bool:Working = 
SDKCall(g_hSDKCall_AcceptEntityInput, input, activator, caller, dest, 
outputid);
  if(Working) PrintToServer("true");
  else 
PrintToServer("false");
 }
}

However, invalid entity index error.
I think the problem variant_t.
But I do not know anymore how to modify. Can you advise me?
ys24ys is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-02-2015 , 05:08   Re: I need help SDKCall using
Reply With Quote #2

Why are using an sdk call for this?

This can be achieved via sourcemod inbuilt entity functions.
__________________
Neuro Toxin is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-02-2015 , 07:32   Re: I need help SDKCall using
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
Why are using an sdk call for this?

This can be achieved via sourcemod inbuilt entity functions.
He's trying to do it in a mod that SourceMod does not yet ship any gamedata for.

The solution is still to just add the gamedata, rather than manually rolling SDKCalls.
psychonic is offline
ys24ys
Junior Member
Join Date: Nov 2013
Old 09-02-2015 , 16:26   Re: I need help SDKCall using
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
Why are using an sdk call for this?

This can be achieved via sourcemod inbuilt entity functions.
this game is not supported sourcemod-gamedata.
can't using entity functions.
ys24ys is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-02-2015 , 17:09   Re: I need help SDKCall using
Reply With Quote #5

Quote:
Originally Posted by ys24ys View Post
this game is not supported sourcemod-gamedata.
can't using entity functions.
SourceMod does allow modified gamedata files ONLY in a subfolder in the gamedata folder, but I can't remember the name the folder must be.
Edit: the folder name must be "custom"(all lowercase)
__________________

Last edited by WildCard65; 09-02-2015 at 17:12.
WildCard65 is offline
ys24ys
Junior Member
Join Date: Nov 2013
Old 09-06-2015 , 03:58   Re: I need help SDKCall using
Reply With Quote #6

Quote:
Originally Posted by WildCard65 View Post
SourceMod does allow modified gamedata files ONLY in a subfolder in the gamedata folder, but I can't remember the name the folder must be.
Edit: the folder name must be "custom"(all lowercase)
This game is 'hard coding' by developers.
So I can not obtain voffset value based on the name of the function.
I only want to use that function only.
However, the argument that the value of the function is unclear.
ys24ys is offline
ys24ys
Junior Member
Join Date: Nov 2013
Old 09-06-2015 , 04:07   Re: I need help SDKCall using
Reply With Quote #7

I've solved this problem. Thank you for giving your interest.

Last edited by ys24ys; 09-06-2015 at 06:41.
ys24ys is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-06-2015 , 11:08   Re: I need help SDKCall using
Reply With Quote #8

Quote:
Originally Posted by ys24ys View Post
This game is 'hard coding' by developers.
So I can not obtain voffset value based on the name of the function.
I'm not quite sure what "hard coding" means in this context, but offsets for it in SM gamedata should work like any other.

Here is a dump of the player entity vtable for Codename CURE:
Spoiler


So you'd have something like this in gamedata/sdktools.games/custom/cure.games.txt
Code:
"Games"
{
    "cure"
    {
        "Offsets"
        {
            "AcceptInput"
            {
                "windows"    "36"
                "linux"    "37"
                "mac"    "37"
            }
        }
    }
}
And then SourceMod's AcceptEntityInput native in SDKTools should work as-is.

Last edited by psychonic; 09-06-2015 at 11:09.
psychonic 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 09:46.


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