Raised This Month: $ Target: $400
 0% 

HamOnControl


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-14-2009 , 13:42   HamOnControl
Reply With Quote #1

can someone help me how to use exactly hamsandwich on this plugin http://forums.alliedmods.net/showthread.php?t=87232

i tryed some suggestions but i failed.
I'm a begginer on ham and idk exactly how to use.
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-14-2009 , 15:25   Re: HamOnControl
Reply With Quote #2

I don't see anything that is Ham-able (lol).
__________________
fysiks is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-14-2009 , 15:53   Re: HamOnControl
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
I don't see anything that is Ham-able (lol).
PHP Code:
/**
     * Description:        Not entirely sure.
     * Forward params:    function(this, idOn)
     * Return type:        Integer (boolean).
     * Execute params:    ExecuteHam(Ham_OnControls, this, idOn);
     */
    
Ham_OnControls
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-14-2009 , 16:01   Re: HamOnControl
Reply With Quote #4

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_OnControls"func_vehicle""FuncVehicle_OnControls"1)
}

public 
FuncVehicle_OnControls(iVehicleid)
{
    
// id has taken control on iVehicle

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-14-2009 , 16:17   Re: HamOnControl
Reply With Quote #5

Quote:
Originally Posted by tuty View Post
PHP Code:
/**
     * Description:        Not entirely sure.
     * Forward params:    function(this, idOn)
     * Return type:        Integer (boolean).
     * Execute params:    ExecuteHam(Ham_OnControls, this, idOn);
     */
    
Ham_OnControls
You should have put that in your first post so I wouldn't "make a fool of myself".
__________________
fysiks is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-14-2009 , 16:20   Re: HamOnControl
Reply With Quote #6

ok, sorry about that... you are not a fool...
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-14-2009 , 16:52   Re: HamOnControl
Reply With Quote #7

Example of what you can do with Ham_OnControls and Ham_Use :
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Drive"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

/*
TRAIN_ACTIVE 128
TRAIN_NEW 192
TRAIN_OFF 0
TRAIN_NEUTRAL 1
TRAIN_SLOW 2
TRAIN_MEDIUM 3
TRAIN_FAST 4
TRAIN_BACK 5
*/
#define TRAIN_ACTIVE    0x80 
#define TRAIN_NEW        0xc0
#define TRAIN_OFF        0x00
#define TRAIN_NEUTRAL    0x01
#define TRAIN_SLOW        0x02
#define TRAIN_MEDIUM    0x03
#define TRAIN_FAST        0x04 
#define TRAIN_BACK        0x05

#define m_iTrain        350

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_OnControls"func_vehicle""FuncVehicle_OnControls"1)
    
RegisterHam(Ham_Use"func_vehicle""FuncVehicle_Use"1)
}

public 
FuncVehicle_OnControls(iVehicleid)
{
    
// id has taken control on iVehicle
    
new szModel[64]
    
pev(iVehiclepev_modelszModelcharsmax(szModel))
    
client_print(idprint_center"Good Drive %s :)"szModel[0] == '*' "" "on %s"szModel)
}

public 
FuncVehicle_Use(iVehicleidiCalleriUseTypeFloat:fValue)
{
    
// id is driving iVehicle

    // fValue
    //    30.0 = turning right
    //    20.0 = turning left
    //    1.0 = forward
    //    -1.0 = back
    
static szMessage[64], n
    n 
0
    
switch( fValue )
    {
        case 
20.0:+= formatex(szMessagecharsmax(szMessage), "Turning left")
        case 
30.0:+= formatex(szMessagecharsmax(szMessage), "Turning right")
    }

    switch( 
get_pdata_int(idm_iTrain5) )
    {
        case 
TRAIN_SLOW:+= formatex(szMessage[n], charsmax(szMessage)-n" Driving Slow")
        case 
TRAIN_MEDIUM:+= formatex(szMessage[n], charsmax(szMessage)-n" Driving Medium")
        case 
TRAIN_FAST:+= formatex(szMessage[n], charsmax(szMessage)-n" Driving Fast")
        case 
TRAIN_BACK:+= formatex(szMessage[n], charsmax(szMessage)-n" Driving BackWards")
    }

    
client_print(idprint_centerszMessage)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 08:59.


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