AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ] More terrorist Speed (https://forums.alliedmods.net/showthread.php?t=288317)

Zibi17k 09-26-2016 17:55

[REQ] More terrorist Speed
 
Hallo
Need plugin increase terrorist speed.
Somebody have this plugin?

Nursik 09-27-2016 03:32

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by Zibi17k (Post 2457303)
Hallo
Need plugin increase terrorist speed.
Somebody have this plugin?

PHP Code:

#pragma semicolon 1
#include sourcemod

ConVar g_tspeed;

public 
void OnPluginStart()
{
    
g_tspeed CreateConvar("terrorist_speed""200.0""Sets terrorist team's speed");
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_SpawnOnPlayerSpawn);
    
SDKHook(clientSDKHook_WeaponSwitchOnPlayerWeaponSwitch);
}

public 
OnPlayerSpawn(client)
{
    if (
GetClientTeam(client) == 3)
    {
         
SetEntPropFloat(client"m_flLaggedMovementValue"GetConvarFloat(g_tspeed));
    }
}

public 
OnPlayerWeaponSwitch(client)
{
    if (
GetClientTeam(client) == 3)
    {
        
SetEntPropFloat(client"m_flLaggedMovementValue"GetConvarFloat(g_tspeed));
    }


Set terrorist_speed cvar to the speed you want, but i haven't tested it. You'll have to compile this as an .sp file.

Zibi17k 09-27-2016 04:42

Re: [REQ] More terrorist Speed
 
Thx, but I can't complier it
Code:

// terrorist_speed.sp(8) : error 017: undefined symbol "CreateConvar"
// terrorist_speed.sp(8) : warning 213: tag mismatch
// terrorist_speed.sp(13) : error 017: undefined symbol "SDKHook"
// terrorist_speed.sp(14) : error 017: undefined symbol "SDKHook"
// terrorist_speed.sp(21) : error 035: argument type mismatch (argument 2)
// terrorist_speed.sp(29) : error 035: argument type mismatch (argument 2)
//
// 5 Errors.


shanapu 09-27-2016 08:41

Re: [REQ] More terrorist Speed
 
try these:

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>

ConVar g_tspeed;

public 
void OnPluginStart()
{
    
g_tspeed CreateConVar("terrorist_speed""200.0""Sets terrorist team's speed");
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_SpawnOnPlayerSpawn);
    
SDKHook(clientSDKHook_WeaponSwitchOnPlayerWeaponSwitch);
}

public 
void OnPlayerSpawn(int client)
{
    if (
GetClientTeam(client) == 3)
    {
         
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    }
}

public 
void OnPlayerWeaponSwitch(int client)
{
    if (
GetClientTeam(client) == 3)
    {
        
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    }



Nursik 09-27-2016 11:16

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by shanapu (Post 2457425)
try these:

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>

ConVar g_tspeed;

public 
void OnPluginStart()
{
    
g_tspeed CreateConVar("terrorist_speed""200.0""Sets terrorist team's speed");
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_SpawnOnPlayerSpawn);
    
SDKHook(clientSDKHook_WeaponSwitchOnPlayerWeaponSwitch);
}

public 
void OnPlayerSpawn(int client)
{
    if (
GetClientTeam(client) == 3)
    {
         
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    }
}

public 
void OnPlayerWeaponSwitch(int client)
{
    if (
GetClientTeam(client) == 3)
    {
        
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    }



lol, i forgot to include sdkhooks. And i still don't understand what are the "void"'s for in the "public"'s. Oh, the coding in cs:go is different than in tf2... Oh and Zibi17k, when you compile it you'll have to be using the values in floats, not integers. Float examples: 300.0, 450.50, 520.0. Integer examples: 200, 300, 100.

xines 09-27-2016 11:32

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by Nursik (Post 2457447)
And i still don't understand what are the "void"'s for in the "public"'s.

Void, basically means no return is needed.
Like if you did a Action function, then you would need to tell the function what to return, like:
PHP Code:

return Plugin_Continue;        /**< Continue with the original action */
return Plugin_Changed;        /**< Inputs or outputs have been overridden with new values */
return Plugin_Handled;        /**< Handle the action at the end (don't call it) */
return Plugin_Stop;        /**< Immediately stop the hook chain and handle the original */ 


Nursik 09-27-2016 11:36

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by xines (Post 2457454)
Void, basically means no return is needed.
Like if you did a Action function, then you would need to tell the function what to return, like:
PHP Code:

return Plugin_Continue;        /**< Continue with the original action */
return Plugin_Changed;        /**< Inputs or outputs have been overridden with new values */
return Plugin_Handled;        /**< Handle the action at the end (don't call it) */
return Plugin_Stop;        /**< Immediately stop the hook chain and handle the original */ 


Thanks, mate. Can you or someone tell me why people use iClient or int client instead of client? Is that because of the "new-decl" pragma?

Mitchell 09-27-2016 11:36

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by Nursik (Post 2457447)
Oh, the coding in cs:go is different than in tf2....

Nah, you were just mixing the old syntax with the newer syntax.

Also, Terrorist team is Team 2.
Also hooking OnSpawn instead of the player_spawn doesn't seem like that would work, however it will still work because of the weapon switching.

xines 09-27-2016 11:54

Re: [REQ] More terrorist Speed
 
Try this.

PHP Code:

#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>

ConVar g_tspeed;

public 
void OnPluginStart()
{
    
g_tspeed CreateConVar("terrorist_speed""2.0""Sets terrorist team's speed");
    
HookEvent("player_spawn"PlayerSpawn);
}

public 
Action PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if(
IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
        
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    
    return 
Plugin_Continue;



Nursik 09-27-2016 12:12

Re: [REQ] More terrorist Speed
 
Quote:

Originally Posted by Mitchell (Post 2457457)
Nah, you were just mixing the old syntax with the newer syntax.

Yeah, i noticed, but GetConVarFloat should have worked in both tf2 and cs. And cs has a different netprop than tf2. Plus tf2 has red team as team 3, i think. So that's why i say tf2 is different codewise.

Quote:

Originally Posted by xines (Post 2457460)
Try this.

PHP Code:

#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>

ConVar g_tspeed;

public 
void OnPluginStart()
{
    
g_tspeed CreateConVar("terrorist_speed""2.0""Sets terrorist team's speed");
    
HookEvent("player_spawn"PlayerSpawn);
}

public 
Action PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if(
IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
        
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"g_tspeed.FloatValue);
    
    return 
Plugin_Continue;



Should hook weapon switch, because speed changes when you change weps. And the speed value is so low, didn't know about that in CS:GO.


All times are GMT -4. The time now is 07:33.

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