Raised This Month: $32 Target: $400
 8% 

[Question] Tinkering with FOV


Post New Thread Reply   
 
Thread Tools Display Modes
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
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 09-25-2007 , 18:38   Re: [Question] Tinkering with FOV
Reply With Quote #12

did you try use EventHookMode_Post on HookEvent
Because as far as I can understand, you setting his fov even before the player spawn
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
SamuraiBarbi
Senior Member
Join Date: Aug 2006
Location: United States
Old 09-26-2007 , 04:04   Re: [Question] Tinkering with FOV
Reply With Quote #13

Alrighty I changed the EventHookMode_Pre to EventHookMode_Post and but nothing happens ingame. I should note also I don't receive any compiler errors.
SamuraiBarbi is offline
Send a message via AIM to SamuraiBarbi Send a message via MSN to SamuraiBarbi Send a message via Yahoo to SamuraiBarbi
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 10-02-2007 , 00:50   Re: [Question] Tinkering with FOV
Reply With Quote #14

You should use the SetEntData etc. instead of using signatures. It looks like Nican posted a working example.
__________________
sslice is offline
SamuraiBarbi
Senior Member
Join Date: Aug 2006
Location: United States
Old 10-02-2007 , 02:43   Re: [Question] Tinkering with FOV
Reply With Quote #15

His previous example, although it did work if I altered my fov and then changed weapons, my fov would reset.

EDIT: Found a way around the weapons thing so now I can just go with Nicans original solution to altering FOV. Thanks for the suggestions and all your help Nican!

Last edited by SamuraiBarbi; 10-02-2007 at 03:23.
SamuraiBarbi is offline
Send a message via AIM to SamuraiBarbi Send a message via MSN to SamuraiBarbi Send a message via Yahoo to SamuraiBarbi
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 23:52.


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