Raised This Month: $32 Target: $400
 8% 

Award Grenades: Reloaded v1.5


Post New Thread Reply   
 
Thread Tools Display Modes
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-15-2008 , 01:56   Re: Award Grenades
Reply With Quote #21

Quote:
Connorr's not being cocky. He's rightly pointing out that someone with more experience would have done a much better job. There are still numerous errors.
nvm...
Didn't take it personally :p

Quote:
  • Scrap the loop below 'Check player names' in favour of cmd_target() or find_player().
  • Names can be 31 characters long.
  • The fourth parameter to cmd_access() in give_nade() should be 3.
  • Don't return PLUGIN_HANDLED in forwards that can't be blocked.
  • Use 'break' to exit loops.
  • You should evaluate whether the first element of an array is false rather using equal() to determine if a string is empty.
Got all of that and will edit ;)

Quote:
  • You need to check that str_to_num() doesn't return 0.
  • award_fb_amount is superfluous.
  • There are many places where you should cache native return values.
Didn't get these ones
Need more explaination plz

Quote:
You overwrite a cvar pointer (award_nades) with a value rather than updating the cvar itself.
But it's giving the same effect
But also, how should I fix that?
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-15-2008 , 02:59   Re: Award Grenades
Reply With Quote #22

The cvar pointer have to stay with the same value during all map.
Only the cvar VALUE have to change with set_pcvar_num(POINTER, VALUE), where VALUE is your str_to_num thing ;)

@Lee
I don't use modules.ini except for modules that can't autoload.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-15-2008 , 03:02   Re: Award Grenades
Reply With Quote #23

Quote:
Originally Posted by connorr View Post
The cvar pointer have to stay with the same value during all map.
Only the cvar VALUE have to change with set_pcvar_num(POINTER, VALUE), where VALUE is your str_to_num thing ;)
Got that!
Can you explain these plz
Quote:
  • You need to check that str_to_num() doesn't return 0.
  • award_fb_amount is superfluous.
  • There are many places where you should cache native return values.
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-15-2008 , 06:16   Re: Award Grenades v1.1
Reply With Quote #24

v1.1
Is it alright now???
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-15-2008 , 11:24   Re: Award Grenades v1.1
Reply With Quote #25

i think that there are four parameters to the give_nade console command including the command itself so instead of
PHP Code:
if (!cmd_access(idlevelcid3))
  return 
PLUGIN_HANDLED 
it should be
PHP Code:
if (!cmd_access(idlevelcid4))
  return 
PLUGIN_HANDLED 
just thinking... (register_concmd("1.give_nade", "give_nade", ADMIN_LEVEL_D, "2.<name> 3.<nade he,fb,sg> 4.<amount 1,2>")) am i wrong here?

another thing, again not sure, i think that
PHP Code:
 new arg[21]
 
read_argv(1arg20)
 if(!
arg[0]) {
  
console_print(id"[AG] Usage: award_nades_toggle <0|1> 0 = off, 1 = on")
  return 
PLUGIN_HANDLED
 

will be the same as simply not putting anything in the award_nades_toggle (for example an admin types: award_nade_toggle with nothing afterwards):
PHP Code:
register_concmd("award_nades_toggle""award_nades_toggle"ADMIN_RCON"[AG] award_nades_toggle <0|1> 0 = off, 1 = on"); 
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 08-15-2008 at 11:49.
Dores is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 08-15-2008 , 12:02   Re: Award Grenades v1.1
Reply With Quote #26

Quote:
Originally Posted by dor123 View Post
i think that there are four parameters to the give_nade console command including the command itself so instead of
PHP Code:
if (!cmd_access(idlevelcid3))
  return 
PLUGIN_HANDLED 
it should be
PHP Code:
if (!cmd_access(idlevelcid4))
  return 
PLUGIN_HANDLED 
No, it shouldn't. One of those parameters is optional. The command itself should not be called a parameter.

Quote:
Originally Posted by dor123 View Post
PHP Code:
 new arg[21]
 
read_argv(1arg20)
 if(!
arg[0]) {
  
console_print(id"[AG] Usage: award_nades_toggle <0|1> 0 = off, 1 = on")
  return 
PLUGIN_HANDLED
 

will be the same as simply not putting anything in the award_nades_toggle (for example an admin types: award_nade_toggle with nothing afterwards):
PHP Code:
register_concmd("award_nades_toggle""award_nades_toggle"ADMIN_RCON"[AG] award_nades_toggle <0|1> 0 = off, 1 = on"); 
I don't know what it is you're trying to say. That code detects whether the first argument is absent. It's useless since cmd_access() will have already taken care of things by then.

If I were to release this plugin (personally I think it's a pointless plugin and should have stayed in Suggestions/Requests like all of the scripts I've ever posted), I'd rewrite it from scratch. By the time it reaches a high quality, it won't be yours anymore. I'm sorry that I'm not prepared to offer anymore constructive advice, but my patience with inexperienced scripters is wearing very thin. There are a handful of people (not you Sam Tsuki) that genuinely make me angry when I read their "advice". Perhaps I should write that scripting tutorial to give me more of a right to hold people to the high standards I try to obtain myself. It's good that people are trying to learn, but learning by experimentation rather than waiting for people to correct you has to be better for everyone.
__________________
No support via PM.

Last edited by Lee; 08-15-2008 at 17:36.
Lee is offline
xjose93
Member
Join Date: Apr 2008
Old 08-15-2008 , 13:49   Re: Award Grenades v1.1
Reply With Quote #27

Can u create a cvar to only terrorist if kill, give HE. Thx and bye.
xjose93 is offline
YeanS
Member
Join Date: Jun 2008
Old 08-15-2008 , 14:48   Re: Award Grenades v1.1
Reply With Quote #28

Good suggestion ;)
__________________
YeanS is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-15-2008 , 15:03   Re: Award Grenades v1.1
Reply With Quote #29

Quote:
i think that there are four parameters to the give_nade console command including the command itself so instead of
PHP Code:
PHP Code:
if (!cmd_access(idlevelcid3))
  return 
PLUGIN_HANDLED 

it should be
PHP Code:
PHP Code:
if (!cmd_access(idlevelcid4))
  return 
PLUGIN_HANDLED 

just thinking... (register_concmd("1.give_nade", "give_nade", ADMIN_LEVEL_D, "2.<name> 3.<nade he,fb,sg> 4.<amount 1,2>")) am i wrong here?
Looks like Lee answered that
Quote:
another thing, again not sure, i think that
PHP Code:
PHP Code:
new arg[21]
 
read_argv(1arg20)
 if(!
arg[0]) {
  
console_print(id"[AG] Usage: award_nades_toggle <0|1> 0 = off, 1 = on")
  return 
PLUGIN_HANDLED
 


will be the same as simply not putting anything in the award_nades_toggle (for example an admin types: award_nade_toggle with nothing afterwards):
PHP Code:
register_concmd("award_nades_toggle""award_nades_toggle"ADMIN_RCON"[AG] award_nades_toggle <0|1> 0 = off, 1 = on"); 
Yea forgot about it
Will edit

Quote:
Can u create a cvar to only terrorist if kill, give HE. Thx and bye.
Will do
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
xjose93
Member
Join Date: Apr 2008
Old 08-15-2008 , 15:37   Re: Award Grenades v1.1
Reply With Quote #30

ok
xjose93 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 22:59.


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