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

PaintBall


Post New Thread Reply   
 
Thread Tools Display Modes
Psyfire
Senior Member
Join Date: Jan 2006
Old 04-04-2007 , 16:27   Re: PaintBall
Reply With Quote #31

Hello,

we talked in msn a couple month before. Are you willing to extend this mod? I would run a server for it, but only when you are working on this mod :-)
Psyfire is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-04-2007 , 22:42   Re: PaintBall
Reply With Quote #32

i'm not sure, i will away since 05 to 13 . Maybe after
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
lamzaks
Junior Member
Join Date: May 2007
Old 05-31-2007 , 19:23   Re: PaintBall
Reply With Quote #33

on FY maps it paints shows ony when shoot throw walls
lamzaks is offline
darkassassin
Junior Member
Join Date: Aug 2006
Old 07-07-2007 , 18:07   Re: PaintBall
Reply With Quote #34

same with me, on many maps it was only showing them through wallshots such as assault, dust2, and other maps like those.
darkassassin is offline
djbread
Junior Member
Join Date: Jul 2007
Old 07-28-2007 , 07:14   Re: PaintBall
Reply With Quote #35

idk if this is how its supposed to be but....the first weapon i shoot is the only weapon that can show the paintballs, is there anything i can change so its for all weaps immediatly wen u switch in the source code
djbread is offline
Spechal
Junior Member
Join Date: Oct 2007
Old 10-24-2007 , 16:19   Re: PaintBall
Reply With Quote #36

I am having the same problem as djbread and would also like to extend this to 1 shot kills like real paintball.

Anyone have any pointers?

I can program C and PHP.
Spechal is offline
Spechal
Junior Member
Join Date: Oct 2007
Old 10-25-2007 , 01:22   Re: PaintBall
Reply With Quote #37

I am also noticing that the paint doesn't stick to the player until the fatal shot.

Paint does not stick to boxes either.
Spechal is offline
Spechal
Junior Member
Join Date: Oct 2007
Old 10-25-2007 , 02:11   Re: PaintBall
Reply With Quote #38

Here is the code for the one shot kill style paintball

All that is new is a cvar

paintball_oneshotkill 0 | 1 (Default: 0)

Code:
/*******************************************************************************
                            AMX Paint Ball


  Author: KRoTaL
  Updated by: Spechal
  Version: 0.6
  - Ported to AMX MOD X by SAMURAI and Updated by Spechal!

  0.1    Release
  0.2    Optimization + added cvar paintball_randomcolor
  0.3    Added cvar paintball_lifetime
  0.4    Added pcvars
  0.5 (10/02/2007) - Added a new cvar (read on Cvars part)
  0.6 (10/24/2007) - Added one shot kill cvar


  Cvars:

  paintball "1"    -  0: disables the plugin
                      1: enables the plugin

  paintball_randomcolor "0"   - 0: use defined colors
                                1: completely random colors
                NEW :
                2: by team functions :
                   players from CT Team will have blue colors
                   players from T Team will have red colors
                                
  paintball_maxballs "200"    - how many balls (entities) on the map can be created by the plugin
                                decrease the value if your server crashes
                                
  paintball_lifetime "10"   -   lifetime in seconds of the colored entities
  
  paintball_oneshotkill "0"   -  0 | 1 -- kill enemy with one shot


  Setup:

  Install the amxx file.
  Enable Engine and Cstrike Module


*******************************************************************************/

#include <amxmodx>
#include <engine>
#include <cstrike>

#define MAX_COLORS 9


new g_paintSprite[2][] = {"sprites/bhit.spr", "sprites/richo1.spr"}
new g_paintColors[MAX_COLORS][3] = {
{255,255,255}, // white
{255,0,0}, // red
{0,255,0}, // green
{0,0,255}, // blue
{255,255,0}, // yellow
{255,0,255}, // magenta
{0,255,255}, // cyan
{255,20,147}, // pink
{255,165,0} // orange
}

new lastwpn[33]
new lastammo[33]
new g_ballsnum = 0

// Cvars //
new paintball
new paintball_lifetime
new paintball_randomcolor
new paintball_maxballs
// spechal
new paintball_oneshotkill
// end


public plugin_init()
{
  register_plugin("Paint Ball", "0.6", "KRoTaL, SAMURAI, Spechal")
  paintball = register_cvar("paintball", "1")
  paintball_randomcolor = register_cvar("paintball_randomcolor", "0")
  paintball_maxballs = register_cvar("paintball_maxballs", "200")
  paintball_lifetime = register_cvar("paintball_lifetime", "10")
  // spechal
  paintball_oneshotkill = register_cvar("paintball_oneshotkill", "0")
  register_event("Damage", "check_oneshotkill", "b")
  // end
  register_event("CurWeapon", "make_paint", "be", "3>0")
  register_logevent("new_round", 2, "0=World triggered", "1=Round_Start")
}

public plugin_precache()
{
  precache_model("sprites/bhit.spr")
  precache_model("sprites/richo1.spr")
}

stock worldInVicinity(Float:origin[3]) {
  new ent = find_ent_in_sphere(-1, origin, 4.0)
  while(ent > 0)
  {
    if(entity_get_float(ent, EV_FL_health) > 0 || entity_get_float(ent, EV_FL_takedamage) > 0.0)
      return 0
    ent = find_ent_in_sphere(ent, origin, 4.0)
  }

  new Float:traceEnds[8][3], Float:traceHit[3], hitEnt

  traceEnds[0][0] = origin[0] - 2.0
  traceEnds[0][1] = origin[1] - 2.0
  traceEnds[0][2] = origin[2] - 2.0

  traceEnds[1][0] = origin[0] - 2.0
  traceEnds[1][1] = origin[1] - 2.0
  traceEnds[1][2] = origin[2] + 2.0

  traceEnds[2][0] = origin[0] + 2.0
  traceEnds[2][1] = origin[1] - 2.0
  traceEnds[2][2] = origin[2] + 2.0

  traceEnds[3][0] = origin[0] + 2.0
  traceEnds[3][1] = origin[1] - 2.0
  traceEnds[3][2] = origin[2] - 2.0

  traceEnds[4][0] = origin[0] - 2.0
  traceEnds[4][1] = origin[1] + 2.0
  traceEnds[4][2] = origin[2] - 2.0

  traceEnds[5][0] = origin[0] - 2.0
  traceEnds[5][1] = origin[1] + 2.0
  traceEnds[5][2] = origin[2] + 2.0

  traceEnds[6][0] = origin[0] + 2.0
  traceEnds[6][1] = origin[1] + 2.0
  traceEnds[6][2] = origin[2] + 2.0

  traceEnds[7][0] = origin[0] + 2.0
  traceEnds[7][1] = origin[1] + 2.0
  traceEnds[7][2] = origin[2] - 2.0

  for (new i = 0; i < 8; i++) {
    if (PointContents(traceEnds[i]) != CONTENTS_EMPTY)
    {
      return 1
    }

    hitEnt = trace_line(0, origin, traceEnds[i], traceHit)
    if (hitEnt != -1)
    {
      return 1
    }
    for (new j = 0; j < 3; j++) {
      if (traceEnds[i][j] != traceHit[j])
      {
        return 1
      }
    }
  }

  return 0
}

public make_paint(id)
{
  
  new wpn = read_data(2)
  new ammo = read_data(3)
  
  new CsTeams:playert = cs_get_user_team(id)
  
  if(get_pcvar_num(paintball) == 1 && lastammo[id] > ammo)
  {
    new iOrigin[3]
    get_user_origin(id, iOrigin, 4)
    new Float:fOrigin[3]
    IVecFVec(iOrigin, fOrigin)

    if(g_ballsnum < get_pcvar_num(paintball_maxballs) /*get_num_ents() < (global_get_int(GV_INT_maxEntities) - 100)*/ && worldInVicinity(fOrigin))
    {
      new ent = create_entity("info_target")
      if(ent > 0)
      {
        entity_set_string(ent, EV_SZ_classname, "paint_ent")
        entity_set_int(ent, EV_INT_movetype, 0)
        entity_set_int(ent, EV_INT_solid, 0)
        entity_set_model(ent, g_paintSprite[random_num(0,1)])
        new r, g, b
        if(get_pcvar_num(paintball_randomcolor) == 0)
        {
          new i = random_num(0, MAX_COLORS-1)
          r = g_paintColors[i][0]
          g = g_paintColors[i][1]
          b = g_paintColors[i][2]
        }
        else if(get_pcvar_num(paintball_randomcolor) == 1)
        {
          r = random_num(64,255)
          g = random_num(64,255)
          b = random_num(64,255)
        }
    
        else if(get_pcvar_num(paintball_randomcolor) == 2)
         {
         if(playert == CS_TEAM_CT)
        {            
            r = 0
            g = 0
            b = 255
        }
        
        else 
        {
            r = 255
            g = 0
            b = 0
        }
    }
        
        set_rendering(ent, kRenderFxNoDissipation, r, g, b, kRenderGlow, 255)
        entity_set_origin(ent, fOrigin)
        entity_set_int(ent, EV_INT_flags, FL_ALWAYSTHINK)
        entity_set_float(ent, EV_FL_nextthink, get_gametime() + get_pcvar_float(paintball_lifetime))
        ++g_ballsnum
      }
    }
  }
  lastwpn[id] = wpn
  lastammo[id] = ammo
  
}

public pfn_think(entity) {
  if(entity > 0) {
    new class[32]
    entity_get_string(entity, EV_SZ_classname, class, 31)
    if(equal(class, "paint_ent")) {
      remove_entity(entity)
      --g_ballsnum
    }
  }
}

public new_round()
{
  remove_entity_name("paint_ent")
  g_ballsnum = 0
}

// spechal
public check_oneshotkill(id) {
  if(get_pcvar_num(paintball_oneshotkill) == 1 && get_user_health(id) < 100){
    killPlayer(id)
  }
}
public killPlayer(id){
  user_kill(id)
  set_hudmessage( 0, 100, 0, 0.06, 0.8, 0, 6.0, 12.0, 0.5, 0.5, 162 )
    show_hudmessage( id, "You've been shot!")
}
// end



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Enjoy

## Edit
If someone would like to let me know how to get a users starting health, that would be great. Then I could modify the script to work with WC3 mods .. humans have more than 100 life

Last edited by Spechal; 10-26-2007 at 00:53.
Spechal is offline
Spechal
Junior Member
Join Date: Oct 2007
Old 10-28-2007 , 10:50   Re: PaintBall
Reply With Quote #39

I've got this running (without one shot kill) at 206.51.232.38:27015 if anyone wants to help me test it out.

Does any action/event fire when a weapon is fired or switched to?
__________________
# 24/7 WC3FT Tampa Paintball + RTD :: 206.51.232.38:27015
^SBD | Spechal [OP]
Spechal is offline
Spechal
Junior Member
Join Date: Oct 2007
Old 10-31-2007 , 13:56   Re: PaintBall
Reply With Quote #40

Anyone know how to make the paint show on the first item hit, instead of the final bullet point?

The paint gets set to most weapons on CurWeapon, but the paint doesn't show unless you shoot through a wall or something first.
__________________
# 24/7 WC3FT Tampa Paintball + RTD :: 206.51.232.38:27015
^SBD | Spechal [OP]
Spechal 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 15:46.


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