Raised This Month: $ Target: $400
 0% 

[CS:S] Grenade Pack 2


Post New Thread Reply   
 
Thread Tools Display Modes
triohala
Junior Member
Join Date: Apr 2012
Old 09-15-2013 , 07:56   Re: [CS:S] Grenade Pack 2
Reply With Quote #51

Here:
Code:
// This file was auto-generated by SourceMod (v1.5.0-dev+3855)
// ConVars for plugin "GrenadePack2.smx"


// Every X rounds the player is reminded of the plugin ['0' = Disable]
// -
// Default: "5"
// Minimum: "0.000000"
// Maximum: "30.000000"
sm_grenadepack2_announce "5"

// Enable or disable the plugin ['0' = Disable]
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_grenadepack2_enabled "1"

// Enforce the limit so that players can't buy their max, use some, then buy more (they can still pick up more if they aren't carrying their max).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_grenadepack2_enforce "1"

// Maximum number of Flashbang's regular players are allowed to carry.
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_flashbang "1"

// Maximum number of Flashbang's VIP players are allowed to carry.
// -
// Default: "4"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_flashbang_vip "2"

// Maximum number of HE Grenades regular players are allowed to carry.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_hegrenade "2"

// Maximum number of HE Grenades VIP players are allowed to carry.
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_hegrenade_vip "3"

// Maximum number of Smoke Grenades regular players are allowed to carry.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_smokegrenade "0"

// Maximum number of Smoke Grenades VIP players are allowed to carry.
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "100.000000"
sm_grenadepack2_smokegrenade_vip "0"

// Use Updater plugin to auto-update GrenadePack2 when updates are available?
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_grenadepack2_update "0"

Last edited by triohala; 09-15-2013 at 07:57.
triohala is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-15-2013 , 11:18   Re: [CS:S] Grenade Pack 2
Reply With Quote #52

Quote:
Originally Posted by triohala View Post
Having problem with this plugin:

Normal player cant buy nades after one (or some) round(s), they geting message that have max grenades (nades), but they dont have any... With VIP player everything okey.

Use SB for authentication.
In your settings, you have a CVar set to 1 which enforces the buy limit... once they buy their limit in a round, they cannot buy any more of that type. They can still pick up dropped ones, just can't buy them. Set sm_grenadepack2_enforce to "0" and you should be good.

PHP Code:
// Enforce the limit so that players can't buy their max, use some, then buy more (they can still pick up more if they aren't carrying their max).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_grenadepack2_enforce "1" 
__________________
View my Plugins | Donate

Last edited by TnTSCS; 09-15-2013 at 11:18.
TnTSCS is offline
triohala
Junior Member
Join Date: Apr 2012
Old 09-15-2013 , 16:32   Re: [CS:S] Grenade Pack 2
Reply With Quote #53

But its limits in a round? So why they cant buy in other round any more if they have no nades?
triohala is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-15-2013 , 22:21   Re: [CS:S] Grenade Pack 2
Reply With Quote #54

Are you running any other mod that keeps event round_end from firing? At event round_end (or round_start) is when all player's limits are reset...
__________________
View my Plugins | Donate
TnTSCS is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-16-2013 , 09:14   Re: [CS:S] Grenade Pack 2
Reply With Quote #55

I just checked the code, and the number of purchased nades is reset on player_spawn event. Every time the player spawns, their number of purchased nade types is set back to 0.

PHP Code:
public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    
// ... <snipped code>
    
    
ResetVariables(clientfalsefalse);
}

public 
ResetVariables(clientbool:Spawnbool:VIP)
{
    
BoughtFB[client] = 0;
    
BoughtHE[client] = 0;
    
BoughtSG[client] = 0;
    
    
// ... <snipped code>

Then the CS_OnBuyCommand handles the rest - I'm going to double check the offsets for the three nade types (HE, FB, and SG), but it should be good to go as is - I'll also test this in game and reply here later.
__________________
View my Plugins | Donate

Last edited by TnTSCS; 09-16-2013 at 09:14.
TnTSCS is offline
triohala
Junior Member
Join Date: Apr 2012
Old 09-17-2013 , 02:59   Re: [CS:S] Grenade Pack 2
Reply With Quote #56

I was looked into code too and found nothing wrong so why I ask help, maybe its something wong with Sourcebans groups authentication?
I use 2 groups:
No-priv player: noflag (Just player)
Group #1: reserved flag (Simple player)
Gruop #2: reserved, custom1 flags (VIP player)

Or maybe zombie reloaded 3.1 mod plugin?
triohala is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-17-2013 , 09:11   Re: [CS:S] Grenade Pack 2
Reply With Quote #57

Here's a new version so you can test. No changes to code except added lateLoad and debugging... If you have a test server that would be the best place to try it... Make sure you set the Updater CVar to 0 for this test.

Get updated files HERE
__________________
View my Plugins | Donate

Last edited by TnTSCS; 02-03-2014 at 13:19.
TnTSCS is offline
triohala
Junior Member
Join Date: Apr 2012
Old 09-17-2013 , 11:40   Re: [CS:S] Grenade Pack 2
Reply With Quote #58

ohh well, its ZR 3.1 mod... on spawn try to regive HE from last round or something and make issue...

Thank you for help

Last edited by triohala; 09-17-2013 at 12:04.
triohala is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 02-03-2014 , 11:28   Re: [CS:S] Grenade Pack 2
Reply With Quote #59

Hi,

version 1.0.9 :
Quote:
L 02/03/2014 - 17:245: [GrenadePack2.smx] [CheckIsPlayerVIP] »Ðل« LetsGo<2
><STEAM_0:1:12157180><> is marked as VIP
L 02/03/2014 - 17:245: [GrenadePack2.smx] [ResetVariables] »Ðل« LetsGo<2><
STEAM_0:1:12157180><> had their variables reset. HE=0, FB=0, SG=0
L 02/03/2014 - 17:245: [SM] Plugin encountered error 4: Invalid parameter or p
arameter type
L 02/03/2014 - 17:245: [SM] Native "Format" reported: String formatted incorre
ctly - parameter 4 (total 3)
L 02/03/2014 - 17:245: [SM] Displaying call stack trace for plugin "GrenadePac
k2.smx":
L 02/03/2014 - 17:245: [SM] [0] Line 328, F:\L4D2\DÚdiÚ DJ\serv01_css\addo
ns\sourcemod\scripting\GrenadePack2.sp::Event _OnPlayerSpawn()
L 02/03/2014 - 17:24:48: [SM] Plugin encountered error 4: Invalid parameter or p
arameter type
L 02/03/2014 - 17:24:48: [SM] Native "Format" reported: String formatted incorre
ctly - parameter 4 (total 3)
L 02/03/2014 - 17:24:48: [SM] Displaying call stack trace for plugin "GrenadePac
k2.smx":
L 02/03/2014 - 17:24:48: [SM] [0] Line 328, F:\L4D2\DÚdiÚ DJ\serv01_css\addo
ns\sourcemod\scripting\GrenadePack2.sp::Event _OnPlayerSpawn()
eric0279 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-03-2014 , 13:18   Re: [CS:S] Grenade Pack 2
Reply With Quote #60

Oops...
Attached Files
File Type: smx GrenadePack2.smx (12.6 KB, 133 views)
File Type: sp Get Plugin or Get Source (GrenadePack2.sp - 139 views - 27.5 KB)
__________________
View my Plugins | Donate
TnTSCS 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 16:27.


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