Quote:
Originally Posted by Nican
http://forums.alliedmods.net/showthread.php?t=57448
You see there is supercmds.gamedata.txt file and this:
PHP Code:
StartPrepSDKCall(SDKCall_Player) PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "SetModel") PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer) hSetModel = EndPrepSDKCall()
Read a little from other people plugins so you can learn from it
|
I tried doing something like that and it didn't work. I do alot of research on the forums, the wiki and looking through peoples plugins I think use what I'm looking for before I post questions. I posted because I'm stumped.
This was the km.mod gamedata I used
Code:
"Games"
{
"cstrike"
{
"Signatures"
{
"SetFOV"
{
"library" "server"
"windows" "\x53\x57\x8b\x7c\x24\x03\x85\xff\x8b\xd9\x75\x07\x5f\x32\xc0\x5b\xc2\x0c\x00\x8b\x83\x08\x0a\x00\x00\x83\xf8\xff\x56\x8d\xb3\x08\x0a\x00\x00"
"linux" "_ZN11CBasePlayer13SetDefaultFOVEi"
}
}
}
}
This was my code
Code:
#pragma semicolon 1
#include <sourcemod>
#include <clients>
#include <sdktools>
#include <sdktools_trace>
new Handle:hsetFOV;
public OnPluginStart()
{
HookEvent("player_spawn", HookPlayerSpawn, EventHookMode_Pre);
InitGameData();
}
public Action:HookPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new userID = GetEventInt(event,"userid");
new user = GetClientOfUserId(userID);
SetFOV(user,145);
}
public Action:SetFOV(user,fov)
{
SDKCall(hsetFOV,user,fov);
}
InitGameData()
{
hgameConf = LoadGameConfigFile("km.mod");
StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetFromConf(hgameConf, SDKConf_Signature, "SetFOV");
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
hsetFOV = EndPrepSDKCall();
}
It didn't work when I tried it. Can please someone post an example or lemme know what I'm doing wrong?