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

[Question] Tinkering with FOV


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SamuraiBarbi
Senior Member
Join Date: Aug 2006
Location: United States
Old 09-25-2007 , 17:13   Re: [Question] Tinkering with FOV
Reply With Quote #11

Quote:
Originally Posted by Nican View Post
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(hGameConfSDKConf_Signature"SetModel")
    
PrepSDKCall_AddParameter(SDKType_StringSDKPass_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?

Last edited by SamuraiBarbi; 09-25-2007 at 17:48.
SamuraiBarbi is offline
Send a message via AIM to SamuraiBarbi Send a message via MSN to SamuraiBarbi Send a message via Yahoo to SamuraiBarbi
 



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:31.


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