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

[CS:S] SoccerMod


Post New Thread Reply   
 
Thread Tools Display Modes
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 12-11-2011 , 07:46   Re: [CS:S] SoccerMod
Reply With Quote #21

Hi,

My aim is to avoid players being killed in one ball hit, it often happens when a player hits the ball very close to an enemy (especially at the beginning of the round when both teams rush to the ball).

I would say, I'd like to reduce them by 50 %.

Thank you,

St00ne

Last edited by St00ne; 12-11-2011 at 07:49.
St00ne is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-11-2011 , 08:20   Re: [CS:S] SoccerMod
Reply With Quote #22

Quote:
Originally Posted by St00ne View Post
Hi,

My aim is to avoid players being killed in one ball hit, it often happens when a player hits the ball very close to an enemy (especially at the beginning of the round when both teams rush to the ball).

I would say, I'd like to reduce them by 50 %.

Thank you,

St00ne
ok then try this

PHP Code:

#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>

#define VERSION "v1.1"

new Handle:sm_soccermod_enable;

public 
Plugin:myinfo =
{
    
name "SM SoccerMod",
    
author "Franc1sco Steam: franug",
    
description "Mod of Soccer for CS:S",
    
version VERSION,
    
url "http://servers-cfg.foroactivo.com/"
}

public 
OnPluginStart()
{
    
CreateConVar("sm_SoccerMod"VERSION"Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);

    
sm_soccermod_enable CreateConVar("sm_soccermod_enable""1""Enables/disables all features of the plugin."FCVAR_NONEtrue0.0true1.0);

    
HookEvent("round_start"Ronda_Empieza);

    
HookEvent("player_spawn"Event_PlayerSpawn);



}

public 
OnMapStart()
{
  if (
GetConVarInt(sm_soccermod_enable) == 1)
  {
        
AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/home2/skin_foot_a2.vmt");
        
AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/home2/skin_foot_a2.vtf");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.dx80.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.dx90.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.phy");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.sw.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.vvd");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.xbox.vtx");
        
AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/away2/skin_foot_a2.vmt");
        
AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/away2/skin_foot_a2.vtf");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.dx80.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.dx90.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.phy");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.sw.vtx");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.vvd");
        
AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.xbox.vtx");

    
//PrecacheModel("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
    //PrecacheModel("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  
}
  
PrecacheModel("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  
PrecacheModel("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
  if (
GetConVarInt(sm_soccermod_enable) == 1)
  {
    new 
userid GetEventInt(event"userid");
    new 
client GetClientOfUserId(userid);

        if (
GetClientTeam(client) == CS_TEAM_T)
        {
           
SetEntityModel(client,"models/player/soccermod/termi/2010/home2/ct_urban.mdl");
           
SetEntityHealth(client250);
        }
        else if (
GetClientTeam(client) == CS_TEAM_CT)
        {
           
SetEntityModel(client,"models/player/soccermod/termi/2010/away2/ct_urban.mdl");
           
SetEntityHealth(client250);
        }
  }
}

public 
Action:Ronda_Empieza(Handle:event,const String:name[],bool:dontBroadcast)
{
  if (
GetConVarInt(sm_soccermod_enable) == 1)
  {
        
ServerCommand("phys_pushscale 900");
        
ServerCommand("phys_timescale 1");
        
ServerCommand("sv_turbophysics 0");
  }
}

public 
Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
{
  if (
GetConVarInt(sm_soccermod_enable) == 1)
  {
      if (
damagetype DMG_FALL || damagetype DMG_BULLET || damagetype DMG_SLASH)
      {
            return 
Plugin_Handled;
      }
      else if (
damagetype DMG_CRUSH)
      {
            
damage = (damage 0.5); // damage reducer
            
return Plugin_Changed;
      }
  }
  return 
Plugin_Continue;

Attached Files
File Type: smx sm_soccermod2.smx (4.8 KB, 179 views)
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 12-11-2011 , 16:12   Re: [CS:S] SoccerMod
Reply With Quote #23

Thanks,

I'll try it and post feedback.
St00ne is offline
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 12-16-2011 , 18:13   Re: [CS:S] SoccerMod
Reply With Quote #24

Hi there, ok it works! Thanks for that last tip ;)

I was afraid the damages would not be always 50 % with this formula, I thought it would go 50 % lower then 50 % lower again and again... but no, I think it works ^^
St00ne is offline
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 01-07-2012 , 11:57   Re: [CS:S] SoccerMod
Reply With Quote #25

Hi,

Soory but my server still freezes very often when I change for a soccer map with this plugin. Not everytime, but very often. I tried like ten times to change the map without the plugin and the server does not freeze.
I also changed my map configs plugin for this one: http://forums.alliedmods.net/showthread.php?p=607079
(the one I used before was unapproved.)
But it still freezes and after a few retries it switches to default starting map on my server.
So it is sure it comes from the plugin.
And indeed, it is not because of the models part.

Could you try to fix this please?

It seems to freeze more if there are new players, instead of just me and my bots for testing
Could it come from the "HookEvent" part at plugin start?
or the "OnClientPutInServer"?
Maybe the sdk hooks usage to get player id, or idk...
I don't know how to code in c++, so please have a look.

Thanks,

St00ne

Last edited by St00ne; 01-11-2012 at 01:33.
St00ne is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 01-13-2012 , 16:33   Re: [CS:S] SoccerMod
Reply With Quote #26

Quote:
Originally Posted by St00ne View Post
Hi,

Soory but my server still freezes very often when I change for a soccer map with this plugin. Not everytime, but very often. I tried like ten times to change the map without the plugin and the server does not freeze.
I also changed my map configs plugin for this one: http://forums.alliedmods.net/showthread.php?p=607079
(the one I used before was unapproved.)
But it still freezes and after a few retries it switches to default starting map on my server.
So it is sure it comes from the plugin.
And indeed, it is not because of the models part.

Could you try to fix this please?

It seems to freeze more if there are new players, instead of just me and my bots for testing
Could it come from the "HookEvent" part at plugin start?
or the "OnClientPutInServer"?
Maybe the sdk hooks usage to get player id, or idk...
I don't know how to code in c++, so please have a look.

Thanks,

St00ne
Check that uploaded models are well and you look in addons/sourcemod/logs in case there have error.


I see no error in the code that may cause a crash.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 01-13-2012 , 17:17   Re: [CS:S] SoccerMod
Reply With Quote #27

Hi, I wish there were errors, so I could copy and paste them here, but there is not any!

I even tried this:

Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>

#define VERSION "v1.1"

new Handle:sm_soccermod_enable;

public Plugin:myinfo =
{
    name = "SM SoccerMod",
    author = "Franc1sco Steam: franug",
    description = "Mod of Soccer for CS:S",
    version = VERSION,
    url = "http://servers-cfg.foroactivo.com/"
}

public OnPluginStart()
{
    CreateConVar("sm_SoccerMod", VERSION, "Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);

    sm_soccermod_enable = CreateConVar("sm_soccermod_enable", "1", "Enables/disables all features of the plugin.", FCVAR_NONE, true, 0.0, true, 1.0);

    HookEvent("round_start", Ronda_Empieza);

    HookEvent("player_spawn", Event_PlayerSpawn);

}

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
  if (GetConVarInt(sm_soccermod_enable) == 1)
  {
    new userid = GetEventInt(event, "userid");
    new client = GetClientOfUserId(userid);

        if (GetClientTeam(client) == CS_TEAM_T)
        {
           SetEntityHealth(client, 250);
        }
        else if (GetClientTeam(client) == CS_TEAM_CT)
        {
           SetEntityHealth(client, 250);
        }
  }
}

public Action:Ronda_Empieza(Handle:event,const String:name[],bool:dontBroadcast)
{
  if (GetConVarInt(sm_soccermod_enable) == 1)
  {
        ServerCommand("phys_pushscale 900");
        ServerCommand("phys_timescale 1");
        ServerCommand("sv_turbophysics 0");
  }
}

public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
{
  if (GetConVarInt(sm_soccermod_enable) == 1)
  {
      if (damagetype & DMG_FALL || damagetype & DMG_BULLET || damagetype & DMG_SLASH)
      {
            return Plugin_Handled;
      }
      else if (damagetype & DMG_CRUSH)
      {
            damage = 0.0;
            return Plugin_Changed;
      }
  }
  return Plugin_Continue;
}
Still freezes...

Regards,

St00ne

Last edited by St00ne; 01-13-2012 at 20:21.
St00ne is offline
333indiana
New Member
Join Date: May 2012
Old 05-14-2012 , 03:29   Re: [CS:S] SoccerMod
Reply With Quote #28

Добрый всем день.
На карте воллейбола (ka_volleyball_v5) плагин не выводит статистику по забитым мячам и голевым пасам. Можно ли сделать что бы плагин показывал в чате игрока который забил мяч и игрока который отдал голевой пас на ka_volleyball_v5, а также показывал статистику в таблице общего счёта кто сколько забил (т.е. точно так же как на картах начинающихся на ka_soccer ... но только кроме:No knife damage (delete from plugin), No bullet damage(delete from plugin),No fall damage(delete from plugin),No damage for ball moving(delete from plugin), Set 250 HP in spawn(delete from plugin),Set soccermod skin in Spawn(delete from plugin),Downloadable skins(delete from plugin).
Спасибо.

Good day to all.

Volleyball on the map (ka_volleyball_v5) plug-in does not display statistics for assists and pocketed balls pasam. Can you make a plugin that would show in the chat player who scored the ball and the player who gave the scoring pass to ka_volleyball_v5, as well as statistics showing the general account in the table as much as they scored (ie, just like on the maps at the beginning ka_soccer ... but also: No knife damage (delete from plugin), No bullet damage (delete from plugin), No fall damage (delete from plugin), No damage for ball moving (delete from plugin), Set 250 HP in spawn (delete from plugin), Set soccermod skin in Spawn (delete from plugin), Downloadable skins (delete from plugin). Leave only the statistics players on points.

Thank you.

Last edited by 333indiana; 05-14-2012 at 03:33.
333indiana is offline
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 05-14-2012 , 09:21   Re: [CS:S] SoccerMod
Reply With Quote #29

Hi,

Just to say that I'm using a different plugin for models, and keep this plugin for all the rest (HP, damages, etc...) and it's working great.
I made a server with only soccer and other sports maps, and there is no crash anymore. Maybe the crashes came from the fact that changing from a surf map or a normal map to a soccer map can make the server freeze sometimes. I think it also happens if you play a normal map, and manually change to a slide race map. Sometimes it freezes.
Now the plugin works fine.

@333indiana: This plugin is not made for other sports than soccer, however, it works because it prevents players from being knife killed or stuff like that.
__________________

*** *** ***
-My plugins-

Last edited by St00ne; 05-14-2012 at 09:22.
St00ne is offline
333indiana
New Member
Join Date: May 2012
Old 05-14-2012 , 10:32   Re: [CS:S] SoccerMod
Reply With Quote #30

Who did the plugins only statistics for player on volleyball map?
333indiana 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 11:27.


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