Raised This Month: $19 Target: $400
 4% 

Deagle Round


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
yousef
Member
Join Date: Jan 2012
Location: Home
Old 08-15-2013 , 11:52   Deagle Round
Reply With Quote #1

Deagle Round

Admin Commands:
deagle_round : starts a deagle round all players will have deagle weapon with 10 bullets and cant buy any weapon or pick up any weapon. when rounds finished every thing will be back normal

Cvars:
deagle_ammo "10" ( default: 10 )
sets deagle ammo
deagle_wait "20" ( default: 20 )
this cvar will make admins cant active deagle round when passed 20 seconds in round

Modules:
Fun
Engine
Cstrike

Credits:
Exolent[jNr] disable buy commands
Pokemonmaster disable pick up weapons
Attached Files
File Type: sma Get Plugin or Get Source (deagle_round.sma - 1662 views - 7.0 KB)
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدً عَبْدُه وَرَسُوْلُه
Multimod Extended
Guess Who Mod
Chicken Mod [BETA]

Last edited by yousef; 08-19-2013 at 20:36.
yousef is offline
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 08-15-2013 , 12:15   Re: Deagle Round
Reply With Quote #2

Post the link for colorchat include so ppl can download.

plugin can be made better

Last edited by sami_spt; 08-15-2013 at 12:15.
sami_spt is offline
yousef
Member
Join Date: Jan 2012
Location: Home
Old 08-15-2013 , 12:45   Re: Deagle Round
Reply With Quote #3

Quote:
Originally Posted by sami_spt View Post
Post the link for colorchat include so ppl can download.
Done, Thanks
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدً عَبْدُه وَرَسُوْلُه
Multimod Extended
Guess Who Mod
Chicken Mod [BETA]

Last edited by yousef; 08-15-2013 at 12:47.
yousef is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2013 , 02:44   Re: Deagle Round
Reply With Quote #4

Problems :

Trie is destroyed at round end, so you can buy is deagle round is set on another round than very 1st one.

If players open buy menu before deagle round is activated, they can buy weapons with the menu once weapons have been stripped and new weapons have been given.


Must :

Use cvar pointers
Don't retrieve 2 times the same cvar value in the same function (deagle_wait)
Change the way to set deagle ammo, actual way is not reliable.


Should :

Use engine client_kill forward instead of FM since engine is already included. (then FM is not required anymore).
You don't need to check teams in client_command forward.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yousef
Member
Join Date: Jan 2012
Location: Home
Old 08-16-2013 , 08:22   Re: Deagle Round
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Problems :

Trie is destroyed at round end, so you can buy is deagle round is set on another round than very 1st one.

If players open buy menu before deagle round is activated, they can buy weapons with the menu once weapons have been stripped and new weapons have been given.


Must :

Use cvar pointers
Don't retrieve 2 times the same cvar value in the same function (deagle_wait)
Change the way to set deagle ammo, actual way is not reliable.


Should :

Use engine client_kill forward instead of FM since engine is already included. (then FM is not required anymore).
You don't need to check teams in client_command forward.
Check plugin now, thanks for help
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدً عَبْدُه وَرَسُوْلُه
Multimod Extended
Guess Who Mod
Chicken Mod [BETA]
yousef is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2013 , 16:17   Re: Deagle Round
Reply With Quote #6

Trie was a good way because you were lowering chars before check commands, now you only register the lower case and it can easily be bypassed.
Just put back the Trie but do never destroy it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yousef
Member
Join Date: Jan 2012
Location: Home
Old 08-16-2013 , 17:19   Re: Deagle Round
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Trie was a good way because you were lowering chars before check commands, now you only register the lower case and it can easily be bypassed.
Just put back the Trie but do never destroy it.
Done.
Questions:
1. I dont have to do TrieDestroy ?
2. What if i added this ?
PHP Code:
public plugin_end( )
{
    
TrieDestroyg_tBuyCommands );

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدً عَبْدُه وَرَسُوْلُه
Multimod Extended
Guess Who Mod
Chicken Mod [BETA]
yousef is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-17-2013 , 05:52   Re: Deagle Round
Reply With Quote #8

tries are automatically destroyed, you don't need to put this, but there is no problem if you destroy it there.

You could check deagleround value as first check on client_command.


You must use deagle_wait cvar pointer
you don't need to convert its integer value to a float since systime is integer.

You may register "weapon_shield" touch as well as weaponbox and armoury_entity
In touch callback, you should at least check if iToucher is in players range (1 to maxplayers)

You must use deagle_ammo cvar pointer

find_ent_by_owner is not a good way to retrieve weapon index.
Also, as you strip weapons before you give deagle, you should retrieve deagle index with give_item return value, then if value is <= 0, you can try to retrieve it with find_ent_by_owner, and then if value is > 0, you can set ammo on it.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-17-2013 at 06:01.
ConnorMcLeod is offline
Old 08-17-2013, 06:22
Programmer
This message has been deleted by ConnorMcLeod.
Old 08-17-2013, 07:09
LordOfNothing
This message has been deleted by ConnorMcLeod.
yousef
Member
Join Date: Jan 2012
Location: Home
Old 08-17-2013 , 09:09   Re: Deagle Round
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
tries are automatically destroyed, you don't need to put this, but there is no problem if you destroy it there.

You could check deagleround value as first check on client_command.


You must use deagle_wait cvar pointer
you don't need to convert its integer value to a float since systime is integer.

You may register "weapon_shield" touch as well as weaponbox and armoury_entity
In touch callback, you should at least check if iToucher is in players range (1 to maxplayers)

You must use deagle_ammo cvar pointer

find_ent_by_owner is not a good way to retrieve weapon index.
Also, as you strip weapons before you give deagle, you should retrieve deagle index with give_item return value, then if value is <= 0, you can try to retrieve it with find_ent_by_owner, and then if value is > 0, you can set ammo on it.
I tried to use cvar pointer but it didnt work first when i used it with "deagle_wait" it didnt tell me that you cant activate deagle round after 20 seconds i played like 1 min and didnt tell me that .. and second i used it with deagle_ammo it gave me 96 bullets and it cvar deagle_ammo was 10
and when i do like this
PHP Code:
cs_set_weapon_ammoPlayersdeagleammo ); 
plugin show me error in console
PHP Code:
L 08/17/2013 16:57:39: [CSTRIKENon-player entity 1 out of range
L 08
/17/2013 16:57:39: [AMXXDisplaying debug trace (plugin "deagle_round.amxx")
L 08/17/2013 16:57:39: [AMXXRun time error 10native error (native "cs_set_weapon_ammo")
L 08/17/2013 16:57:39: [AMXX]    [0deagle_round.sma::DRound (line 113
thats why i used find_ent_by_owner anyways, check plugin now and thanks for your help.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدً عَبْدُه وَرَسُوْلُه
Multimod Extended
Guess Who Mod
Chicken Mod [BETA]
yousef is offline
WhyThis
Senior Member
Join Date: May 2013
Old 08-17-2013 , 09:09   Re: Deagle Round
Reply With Quote #10

why did you don't add color chat in stock -_-
it will be better !
WhyThis 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 10:52.


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