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

[REQ] Plugin CS 1.6 Colored BulletHoles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mystyroi
New Member
Join Date: Sep 2016
Old 09-17-2016 , 17:11   [REQ] Plugin CS 1.6 Colored BulletHoles
Reply With Quote #1

Hello,

I've created my CS 1.6 server with AMX MOD X (latest) and MetaMod (latest) and i've installed many plugins without problems. I know a little bit about plugins (sma source file scripting and working with resources (mdl, sprites and so one), and compiled .amxx file that is specified into the plugins.ini file)

What i want to achieve is to color bullet hole on the wall after every shooting with any kind of weapon.

Why to do it via a plugin ?

I don't want to do it via decals.wad file (cause it needs to be done on client side, not on server if i'm correct. I'm said that because i've already changed decals.wad on my server and nothing occurs for me and others)

I've never found a plugin to do this but in my memory, it existed. Maybe the Paint Ball Decals plugin (by Krot@l, http://www.amxmod.net/forum/showthread.php?tid=421) but it's in .amx format and not .amxx and the AMX Mod backwards compatibility layer doesn't seem to solve the problem (to allow runing this plugin)

Except Paint Ball Mod which is full mod and which includes colored bullet holes, I just want colored bulletHoles and not weapons, models etc...

The result I want is like that :

So i'm newbie in AMXX scripting. I've analyzed paintball mod and extract the interesting parts. It works with a .spr file which contain the "splash" (view paintball.zip) and theses parts :

For the pre-caching :

Code:
precache_model("sprites/paintball.spr");
For the rendering :

Code:
public fw_touch(bullet, ent)
{
engfunc(EngFunc_SetModel, bullet, "sprites/paintball.spr");
}

I've tried to analyze Krot@l one .sma file but it's including VexdUM which is not AMX Mod X compatible

Code:
#include <amxmod>
#include <VexdUM>

#define MAX_DECALS 7 // edit here the maximum number of decals

new g_lastWeapon[33]
new g_lastAmmo[33]
new g_cvar_paintball_decals

new g_decalsnum
new g_decals[MAX_DECALS]

public plugin_init() {
  register_plugin("Paint Ball (Decals)", "0.1", "KRoT@L")
  g_cvar_paintball_decals = register_cvar("paintball_decals", "1")
  register_event("CurWeapon", "eventCurWeapon", "be", "1=1", "3!-1")

  new const decalsNames[MAX_DECALS][] = {
    "{spit1",
    "{spit2", // default
    "{break1",
    "{break2",
    "{break3", // default
    "{smscorch1", // default
    "{smscorch2"
    //"{gaussshot1"
  }

  new decal

  for(new i = 0; i < MAX_DECALS; i++) {
    g_decals[g_decalsnum++] = ((decal = get_decal_index(decalsNames[i])) > 0) ? decal : 0
  }
}

public eventCurWeapon(id) {
  if(get_cvarptr_num(g_cvar_paintball_decals) > 0) {
    new weaponID = read_data(2)
    new ammo = read_data(3)

    const BITS_SKIPPED_WEAPONS = ((1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_C4))

    if(((1<<weaponID) & BITS_SKIPPED_WEAPONS) == 0 && weaponID == g_lastWeapon[id] && ammo < g_lastAmmo[id])
    {
      new origin[3]
      get_user_origin(id, origin, 3)

      message_begin(MSG_BROADCAST, SVC_TEMPENTITY, origin)
      write_byte(TE_WORLDDECAL)
      write_coord(origin[0])
      write_coord(origin[1])
      write_coord(origin[2])
      write_byte(g_decals[random(g_decalsnum)])
      message_end()
    }

    g_lastWeapon[id] = weaponID
    g_lastAmmo[id] = ammo
  }
}
but didn't manage to reproduce it in correct format

I think it's easy for advanced AMXX developers, that's why i need help because i find this forum really useful when i need help (many interseting threads)
Attached Files
File Type: zip paintball.zip (3.3 KB, 335 views)

Last edited by mystyroi; 09-17-2016 at 17:47.
mystyroi is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 09-17-2016 , 17:54   Re: [REQ] Plugin CS 1.6 Colored BulletHoles
Reply With Quote #2

have you seen this one?

https://forums.alliedmods.net/showthread.php?t=48934
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
mystyroi
New Member
Join Date: Sep 2016
Old 09-17-2016 , 18:01   Re: [REQ] Plugin CS 1.6 Colored BulletHoles
Reply With Quote #3

Thank you dude! i've tested it and it works. It's perfect !

But i've doing many searches at typing keywords : amx plugin decals, amx plugin paintball (but it gives me only full mods) and i remember this plugin but i've never found it through my searches (and i though it was krotal's "Paintball Decals.amx" one I used in the past but it was the new one)

That's why i wanted to create or modify one existing.

Last edited by mystyroi; 09-17-2016 at 18:07.
mystyroi is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 09-17-2016 , 18:08   Re: [REQ] Plugin CS 1.6 Colored BulletHoles
Reply With Quote #4

decals?

http://bin.ge/dl/237162/paintball.rar.html
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
mystyroi
New Member
Join Date: Sep 2016
Old 09-17-2016 , 18:21   Re: [REQ] Plugin CS 1.6 Colored BulletHoles
Reply With Quote #5

Thanks for theses too! It's ok for me, its doing what i want.
mystyroi 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 13:46.


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