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

Free guns at night


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
antonioristov29
Junior Member
Join Date: Apr 2020
Old 04-09-2020 , 12:09   Free guns at night
Reply With Quote #1

Hello guys, I am new here!

Is there any way that can somone make plugin wich will makes that every guns, pistols, bombs, ammo will be free, and tu put cvars like
amx_from (from when to start free buy time)
amx_to (when to finish free buying time)

I dont want to have it like manu (csdm menu), just normal to set prices to 0. I want that players can buy on normal shop (when prees B), but for buying guns, pistols, bombs, ammo to not lose money.

Thanks!
antonioristov29 is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-09-2020 , 12:43   Re: Free guns at night
Reply With Quote #2

Quote:
Originally Posted by antonioristov29 View Post
Is there any way that can somone make plugin [...]
Sounds like a request (e.g. you want people to do it for you), and not a scripting question (you want assistance with your current / ongoing scripts).

Quote:
Originally Posted by antonioristov29 View Post
, and tu put cvars like
amx_from (from when to start free buy time)
amx_to (when to finish free buying time)
Sounds like it doesn't really belong in the SourceMod sections, but in the AMX's Suggestions / Requests forum, so I have moved your thread over there.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-11-2020 , 08:02   Re: Free guns at night
Reply With Quote #3

That would require ReGameDLL or Orpheu.
- If your server is using ReHLDS, this can be achieved easily.
- If not, see if you can get this plugin running.

Without any of them, this is what you can do:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#if !defined MAX_PLAYERS
const MAX_PLAYERS 32
#endif

const MONEY_SET 16000
const FLASH_MONEY_ICON 1

new bool:g_bFreeWeapons
new g_pStartg_pEnd

public plugin_init()
{
    
register_plugin("Free Weapons at Night""1.0""OciXCrom")
    
register_message(get_user_msgid("Money"), "OnMoneyChange")
    
register_event("HLTV""OnRoundStart""a""1=0""2=0")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)

    
g_pStart register_cvar("amx_from""23")
    
g_pEnd register_cvar("amx_to""5")

    
OnRoundStart()    
}

public 
OnRoundStart()
{
    
g_bFreeWeapons is_current_time(get_pcvar_num(g_pStart), get_pcvar_num(g_pEnd))
}

public 
OnMoneyChange(iMsgIdiDestid)
{
    
OnPlayerSpawn(id)
}

public 
OnPlayerSpawn(id)
{
    if(
g_bFreeWeapons && is_user_alive(id))
    {
        
cs_set_user_money(idMONEY_SETFLASH_MONEY_ICON)
    }
}

bool:is_current_time(const iStart, const iEnd)
{
    static 
iHourtime(iHour)
    return 
bool:(iStart iEnd ? (iStart <= iHour iEnd) : (iStart <= iHour || iHour iEnd))

This will set your money to $16000 whenever you purchase something during the set hours.
__________________

Last edited by OciXCrom; 04-12-2020 at 07:46.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
antonioristov29
Junior Member
Join Date: Apr 2020
Old 04-11-2020 , 09:38   Re: Free guns at night
Reply With Quote #4

This plugin that you have sent (link) its not working good, have a lot of bugs (tested).
And this plugin that you have sent like code, have only one bug when i am trying to compile.

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

16k.sma(1) : error 013: no entry point (no public functions)

1 Error.
Could not locate output file 16k.amx (compile failed).


Can you please fix?
antonioristov29 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-11-2020 , 09:54   Re: Free guns at night
Reply With Quote #5

There's nothing to fix. You probably didn't copy the code properly.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
antonioristov29
Junior Member
Join Date: Apr 2020
Old 04-11-2020 , 09:58   Re: Free guns at night
Reply With Quote #6

Ups, i have bugged mouse.
I am sorry! Compile it is oke, i will test !
THANKS!
antonioristov29 is offline
antonioristov29
Junior Member
Join Date: Apr 2020
Old 04-11-2020 , 17:19   Re: Free guns at night
Reply With Quote #7

I have tested it on 0/32 server, its work fine. Then I put it on my server 32/32, all we have 16 000 money, but when you try to buy something its says "You have insufficient founds!", plugins give us money, but we can use it. After round finish we have 16 000 again but we can buy only for that money how much we earn with ex round (but its types 16 000). Help???
Screenshot: https://prnt.sc/rxib6g

Please help!
antonioristov29 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-11-2020 , 19:00   Re: Free guns at night
Reply With Quote #8

The messages were being intercepted so money never made it into players' pocket yet showed as that much money was there. Scratched the hint.
__________________

Last edited by DJEarthQuake; 04-13-2020 at 18:00. Reason: code got remade
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-12-2020 , 07:47   Re: Free guns at night
Reply With Quote #9

Edited and tested. Works now.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-12-2020 , 09:16   Re: Free guns at night
Reply With Quote #10

Works on 1.8+. Tested on 1.82 and 1.10.
Checksum 2fe868a7f92cf1edb2e9e4a93ff6ed28 freegunsatnight.sma
Attached Files
File Type: sma Get Plugin or Get Source (freegunsatnight.sma - 65 views - 1.3 KB)
__________________

Last edited by DJEarthQuake; 04-14-2020 at 12:05. Reason: Returned pause.
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

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 05:10.


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