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

[L4D] Clip Modifications...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-09-2010 , 11:38   [L4D] Clip Modifications...
Reply With Quote #1

The Following is suppose to change the player's max clip size for the weapons he uses. I was going to turn it into a percentage so it works for all weapons because if it adds 10 to a shotgun you would have 18 shots...lmao. The problem is, it won't get past KillScore == 50, because I dont see it displaying the message.

PHP Code:
// *********************************************************************************
// PREPROCESSOR
// *********************************************************************************
// *********************************************************************************
#pragma semicolon 1                 // Force strict semicolon mode.
// INCLUDES
// *********************************************************************************
#include <sourcemod>
#include <sdktools>
#include <sdktools_functions>

new Handle:KillScore;


// ------------------------------------------------------------------------
// OnPluginStart()
// ------------------------------------------------------------------------
public OnPluginStart()
{

    
KillScore 0;

    
HookEvent("ammo_pickup"Event_CheckAmmo);
    
HookEvent("infected_death"Event_InfectedDeath);

}
// ------------------------------------------------------------------------
// Event_CheckAmmo()
// ------------------------------------------------------------------------
public Event_CheckAmmo(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
Client GetClientOfUserId(GetEventInt(event"userid"));

    new 
WeaponID GetEntDataEnt2 (ClientFindSendPropOffs "CTerrorPlayer""m_hActiveWeapon"));
    new 
AmmoID GetEntData (WeaponID FindSendPropInfo("CBaseCombatWeapon""m_iClip1"));
    
    
PrintToChatAll("Currently at %d"AmmoID);
}

public 
Event_InfectedDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
Client GetClientOfUserId(GetEventInt(event"userid"));

    
KillScore KillScore 1;

    
PrintToChatAll("Player killed %d infected."KillScore);

    if (
KillScore == 50)
    {
        new 
WeaponID GetEntDataEnt2 (ClientFindSendPropOffs "CTerrorPlayer""m_hActiveWeapon"));
        new 
AmmoID GetEntData (WeaponID FindSendPropInfo("CBaseCombatWeapon""m_iClip1"));
        
        
AmmoID AmmoID 10;
        
SetEntData(WeaponIDFindDataMapOffs(Client"m_iClip1"), AmmoID);

        
PrintToChatAll("Player Was Set To %d"AmmoID);
    }

    else if (
KillScore == 225)
    {
        new 
WeaponID GetEntDataEnt2 (ClientFindSendPropOffs "CTerrorPlayer""m_hActiveWeapon"));
        new 
AmmoID GetEntData (WeaponID FindSendPropInfo("CBaseCombatWeapon""m_iClip1"));

        
AmmoID AmmoID 20;
        
SetEntData(WeaponIDFindDataMapOffs(Client"m_iClip1"), AmmoID);

        
PrintToChatAll("Player Was Set To %d"AmmoID);
    }


Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
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 20:11.


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