AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CSS] 100 balles (https://forums.alliedmods.net/showthread.php?t=166085)

ExtremSystem 08-30-2011 14:10

[CSS] 100 balles
 
Hello,

Sorry have to use a translator to my request but I do not speak English well enough for now :/

So, after several searches on the net, I turn to you to ask if it would be possible to make me a plugin that would:

to have 100 bullets in the magazine all the weapons and bullets of 999 reserves throughout the weapons too.

example:

In the M4 at the origin, there are 30 bullets in the magazine and 90 bullets in reserve

And I would like the M4 (and all other weapons) to go 100 bullets in the magazine and 999 bullets in reserve.

Hoping you have understood me and thanking you in advance.

Regards.

Paparazziv2 08-30-2011 14:55

Re: [CSS] 100 balles
 
yes, i need this plugin, but see.. http://forums.alliedmods.net/showthr...37#post1540737
The answer for your request.. sorry :(.

ExtremSystem 08-30-2011 15:05

Re: [CSS] 100 balles
 
I've see yesterday one server with this plugin/add-on but no admin in this server :/

Bacardi 08-30-2011 15:14

Re: [CSS] 100 balles
 
aahh... I guess weapon clip size can change from weapon files.
Those locate ...orangebox\cstrike\scripts\*.ctx (weapon_ak47.ctx, weapon_m4a1.ctx, etc etc)
But these files need convert to txt file, edit and convert back ctx file.

I just tested and it works but one big problem.
Server files need match players files,
so if you edit weapons features (clip size, prize, dmg, etc etc) from *.ctx, player need same fiels and you can't force players download those files automatically when join server.


There is however one extension, bu I didn't get it work.
[EXTENSION ALL] CTX editor (For anything/everything)


Dam, I think I founded right offset. I peek from DarthNinja plugin [TF2] Set Ammo [v1.0.0]
PHP Code:

FindSendPropInfo("CWeaponCSBase""m_iClip1"); 

But it reset clip size back normal when reload...
*
but you can set, how much player can get ammo when buy weapon.
Code:

"ammo_50AE_max" = "35"
 game replicated
"ammo_762mm_max" = "90"
 game replicated
"ammo_556mm_max" = "90"
 game replicated
"ammo_556mm_box_max" = "200"
 game replicated
"ammo_338mag_max" = "30"
 game replicated
"ammo_9mm_max" = "120"
 game replicated
"ammo_buckshot_max" = "32"
 game replicated
"ammo_45acp_max" = "100"
 game replicated
"ammo_357sig_max" = "52"
 game replicated
"ammo_57mm_max" = "100"
 game replicated
"ammo_hegrenade_max" = "1"
 game replicated
"ammo_flashbang_max" = "2"
 game replicated
"ammo_smokegrenade_max" = "1"
 game replicated


ExtremSystem 08-30-2011 15:41

Re: [CSS] 100 balles
 
Code:

#include <sourcemod>

/*
thx to Infinite Ammo by twistedeuphoria - http://forums.alliedmods.net/showthread.php?t=55381
*/

public Plugin:myinfo = {
    name = "Ammo Script for Zombie:Reloaded",
    author = "[SG-10]Cpt.Moore, Richard Helgeby, Kyle Sanderson",
    description = "Sets 100 bullets to the active weapon at a certain interval.",
    version = "2.1",
    url = "http://jupiter.swissquake.ch/zombie/page"
};

new activeOffset = -1;
new clip1Offset = -1;
new clip2Offset = -1;
new secAmmoTypeOffset = -1;
new priAmmoTypeOffset = -1;

//new Handle:hTimer;
new Handle:cvarInterval;
new Handle:AmmoTimer;

public OnPluginStart()
{
    cvarInterval = CreateConVar("zr_ammo_interval", "999", "How often to reset ammo (in seconds).", _, true, 1.0);
    AutoExecConfig(true, "plugin.zr_ammo");

    activeOffset = FindSendPropOffs("CAI_BaseNPC", "m_hActiveWeapon");
   
    clip1Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip1");
    clip2Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip2");
   
    priAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoCount");
    secAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iSecondaryAmmoCount");
}

public OnConfigsExecuted()
{
    if (AmmoTimer != INVALID_HANDLE) {
        KillTimer(AmmoTimer);
    }
    new Float:interval = GetConVarFloat(cvarInterval);
    AmmoTimer = CreateTimer(interval, ResetAmmo, _, TIMER_REPEAT);
}

public Action:ResetAmmo(Handle:timer)
{
    for (new client = 1; client <= MaxClients; client++)
    {
        if (IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) && IsPlayerAlive(client))
        {
            Client_ResetAmmo(client);
        }
    }
}

public Client_ResetAmmo(client)
{
    new zomg = GetEntDataEnt2(client, activeOffset);
    if (clip1Offset != -1 && zomg != -1)
        SetEntData(zomg, clip1Offset, 100, 4, true);
    if (clip2Offset != -1 && zomg != -1)
        SetEntData(zomg, clip2Offset, 100, 4, true);
    if (priAmmoTypeOffset != -1 && zomg != -1)
        SetEntData(zomg, priAmmoTypeOffset, 100, 4, true);
    if (secAmmoTypeOffset != -1 && zomg != -1)
        SetEntData(zomg, secAmmoTypeOffset, 100, 4, true);
}

what do you think to sp?

Bacardi 08-30-2011 16:16

Re: [CSS] 100 balles
 
Don't know that but I think I get extension [EXTENSION ALL] CTX editor (For anything/everything) work.
Can even create whole new "weapon mod" plugin :P

I start play with this tomorrrow

Bacardi 08-30-2011 16:42

Re: [CSS] 100 balles
 
1 Attachment(s)
Try this, I made quick.
So when you have loaded this plugin, it set all weapons clip size to 100.
It not now reset back normal until you remove plugin and reboot server.
(I was lazy, I made this quick)
Then set rest ammo using cvars what I posted earlier #4

*edit
Included ctx extension+gamedata, plugin source code and plugin.
credits to Swixel

*edit edit
Simple plugin, no configurations.

*UPDATE
Made cvar
Quote:

sm_clipsize_100_enable 0
// When enabled, change all weapons clip size 100
Now it reset clip size on all weapons, use cvar in map configs.

Added log action in SM logs everytime when clip size change, happens when cvar new value different than old value.For debugging if server start crash.
(It spam twice on maps with map config, because server.cfg reset cvar back and map config enabled it after. Ignored it)

Code:

L 09/07/2011 - 10:19:39: -------- Mapchange to de_dust --------
L 09/07/2011 - 10:19:39: [clipsize_100.smx] Changed sm_clipsize_100_enable 0
L 09/07/2011 - 10:19:39: [clipsize_100.smx] Changed sm_clipsize_100_enable 1


ExtremSystem 09-01-2011 20:52

Re: [CSS] 100 balles
 
i've found :D

Place all the txt file in this folder: cstrike\script:

http://www.multiupload.com/DVYN43K8S5

They work on my server ^^

Bacardi 09-01-2011 23:19

Re: [CSS] 100 balles
 
Quote:

Originally Posted by ExtremSystem (Post 1546066)
i've found :D

Place all the txt file in this folder: cstrike\script:

http://www.multiupload.com/DVYN43K8S5

They work on my server ^^

I'll be damned! It works.
And those txt files are converted from ctx files, haven't clue that server use also those txt files. Good finding.

Paparazziv2 09-03-2011 21:05

Re: [CSS] 100 balles
 
thanks for all people, but i open a thread and i received one answer, othe person open a thread and received the plugin. what is the problem with me?.. sorry ajajaa thanks XD!.
Edit: The link of the plugin, all in one and all perfect works?.
But bacardi post a .zip but extremSystem send a .txt files for convert to CTX files?, how to i made it?
I need the link with the plugin working, and need all files in a one link, for example i unzip all files in addons and all files are put in their respective folders






not my fault the way in which I express myself, it sounds as if you were sending, but use the google translator and it sounds like I'm sending just ask someone to send me the link for everyone, as some like us do not understand very good and just want to download the file and leave it as I said.
Sorry and thank you for understanding


All times are GMT -4. The time now is 23:43.

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