AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   TF2 Tools (https://forums.alliedmods.net/showthread.php?t=62423)

Nican 10-26-2007 20:13

TF2 Tools
 
9 Attachment(s)
TF2 tools

Description
For now this plugin is kind of useless, It only give some extra commands to other plugins...
I am working on (Not done) class-blocker and instant build in build phase

Version: 1.2

Installation:
  • Put tftools.smx into /plugins folder
  • Put nican.offsets.txt into /gamedata
  • Put tf2.inc into /scripting/include (Not required)
Note: All folders are related to the SourceMod base folder, in <gamemod>\addons\sourcemod

Avaliable tools for scripters:
PHP Code:

#define TF2_SCOUT 1
#define TF2_SNIPER 2
#define TF2_SOLDIER 3 
#define TF2_DEMOMAN 4
#define TF2_MEDIC 5
#define TF2_HEAVY 6
#define TF2_PYRO 7
#define TF2_SPY 8
#define TF2_ENG 9


/**
 * Changes the level of a turret, the sentry has to be build
 *
 * @param index         Player ID or Sentry ID
 * @param level            Level to change to, 1-3
 * @return                0 = sucess, 
 *                        2=builing state
 *                        3=It is not a sentry
 *                        4=Could not find sentry of Player ID
 *                        5=Client not conneted
 *                        6=not a valid level
 */
native TF_TurretLevel(indexlevel);

/**
 * Finds the turret the player is looking at
 *
 * @param index         Finds by trace to what turrent the player is looking at
 * @return                Sentry id, 0 on failture
 */
native TF_EyeTurret(client);


/**
 * Get the class of the player
 *
 * @param index         Client index
 * @return                class number    
 */
native TF_GetClass(client);

/**
 * Get the max health of the player
 *
 * @param index         Client index
 * @return                Max health
 */
native TF_GetMaxHealth(client);

/**
 * Get client total score
 *
 * @param index         Client index
 * @return                Total score    
 */
native TF_TotalScore(client);

/**
 * Return the CTFPlayerResource id
 *
 * @return                CTFPlayerResource id
 */
native TF_GetResource(client); 


Exemple:
PHP Code:

public Action:MakeTurretThree(clientargs){
    new 
aimtr;
    
aim TF_EyeTurret(client);
    
    if(
aim == 0){
        
ReplyToCommand(client"[NC] You are not looking at a turret!");
        return;
    }
    
    
tr TF_TurretLevel(aim3);
    
    if(
tr == 0){
        
ReplyToCommand(client"[NC] Turret level chaned to 3!");
    } else {
        
ReplyToCommand(client"[NC] Failure!");
    }


I need some ideas to what to do next, gimme some :D


Change log
  • October 26, 2007
    • Initial release
  • October 27, 2007
    • Added class support
  • October 28, 2007
    • Added some more natives

urus 10-26-2007 22:03

Re: TF2 Tools
 
You can make restrict player clasess per team (defined by admin)!?

Nican 10-26-2007 23:12

Re: TF2 Tools
 
I was thinking of doing that now :O

_cm 10-27-2007 09:46

Re: TF2 Tools
 
That would be great! Our server is always filled with pyros and it's just sad. Being able to restrict classes would make a big difference in there. Thumbs up! :up:

Nican 10-27-2007 17:04

Re: TF2 Tools
 
1/2 done

I was able to get Player Class, now I have to set it to a value

K2 10-27-2007 22:08

Re: TF2 Tools
 
Nice Nican, hopefully other mod authors will find this useful.

Bandare 10-28-2007 14:04

Re: TF2 Tools
 
can you define what exactly this does a little better in the top post..... looks great but don't really know what it does.....

thanks :)

FlyingMongoose 10-28-2007 15:31

Re: TF2 Tools
 
it's an api for plugin developers it actually belongs here
http://forums.alliedmods.net/forumdisplay.php?f=112

Lio4 11-04-2007 06:05

Re: TF2 Tools
 
Your plugin doesn't work :(
I put tftools.smx in plugins folder

11 <Error> "TF Tools" (1.2) by Nican132

Nican 11-04-2007 09:17

Re: TF2 Tools
 
Does it show any errors?

Lio4 11-05-2007 07:31

Re: TF2 Tools
 
Sorry, it works, but after the first changelevel :?

flubber 11-05-2007 20:17

Re: TF2 Tools
 
Hello,
Might sound noob but where do i install the inc and txt file?
Thx

Nican 11-05-2007 20:28

Re: TF2 Tools
 
Quote:

Originally Posted by flubber (Post 549942)
Hello,
Might sound noob but where do i install the inc and txt file?
Thx

Everybody has to learn

I edited the first post...

flubber 11-05-2007 20:30

Re: TF2 Tools
 
Thanks :)

Silva506th 11-10-2007 09:37

Re: TF2 Tools
 
where is the /gamedata folder?!?!?!?

Nican 11-10-2007 10:53

Re: TF2 Tools
 
Quote:

Originally Posted by Nican (Post 546525)
Note: All folders are related to the SourceMod base folder, in <gamemod>\addons\sourcemod



All times are GMT -4. The time now is 18:13.

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