Raised This Month: $ Target: $400
 0% 

Proofreading


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-20-2009 , 12:28   Re: Proofreading
Reply With Quote #1

First of thanks alot, It must have tooken quite awhile to do that.

About indenting, when I press Ctrl-I in the compiler, it just brings the code to look like that, and when I indent by myself, it gives me some warnings.

Quote:
This code is extremely redundant. You can store the names and health settings globally in an array and then pass an index into that. If you don't understand what I mean, post and I'll give you an example.
Please do, Im still quite a newb at this.

Quote:
This menu is static, i.e. it never changes depending on game state, so create it once in plugin_init() or a similar forward and store the handle globally.
Im also Quite confused with this one, I know what you mean by creating it in plugin_init, but I dont understand the storing it globally part.

Quote:
The item parameter is all you need.
And that, so just a few I need help with, everything else i can do

Again, Thanks alot
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 12:44   Re: Proofreading
Reply With Quote #2

Quote:
Originally Posted by OneMoreLevel View Post
First of thanks alot, It must have tooken quite awhile to do that.

About indenting, when I press Ctrl-I in the compiler, it just brings the code to look like that, and when I indent by myself, it gives me some warnings.
Use tab instead of spaces.

Quote:
Originally Posted by OneMoreLevel View Post
Please do, Im still quite a newb at this.
PHP Code:
enum MODES
{
    
WM 0,
    
JF,
    
SB,
    
ST,
    
AH,
    
RO,
    
SS
}

new 
Float:gSpeeds[_:MODES] =
{
    
300.0,
    
400.0,
    
350.0,
    
250.0,
    
300.0,
    
325.0,
    
275.0
}

new 
gHealths[_:MODES] =
{
    
200,
    
175,
    
175,
    
255,
    
150,
    
175,
    
200
}

new 
gNames[_:MODES][] =
{
    
"War Machine",
    
"Jet Fighter",
    
"Stealth Bomber",
    
"Scorpion Tank",
    
"Apache Helicopter",
    
"Railgun Operator",
    
"Submarine Seeker"
}

// ...

    
client_printidprint_chat"[AMX] You are now a %s. Type /classinfo for information."gNames[item] )
    
set_user_maxspeedidgSpeeds[item] )
    
set_user_healthidgHealths[item] )

// ...
    
    
switch ( item )
    {
        case 
JF :
            
set_user_renderingidkRenderFxGlowShell000kRenderTransAlpha185 )
        case 
SB :
        {
            
set_user_renderingidkRenderFxGlowShell000kRenderTransAlpha65 )
            
cs_set_user_bpammoidCSW_HEGRENADE)
        }
        case 
SS :
            
set_user_renderingidkRenderFxGlowShell000kRenderTransAlpha130 )
    } 
That's a generalized solution to what you were asking.

Quote:
Originally Posted by OneMoreLevel View Post
Im also Quite confused with this one, I know what you mean by creating it in plugin_init, but I dont understand the storing it globally part.
PHP Code:
new gMenu

public plugin_init()
    
gMenu menu_create"whatever""who cares" )

// ...
    
    
menu_displayidgMenu )

// ...

public plugin_end()
    
menu_destroygMenu 
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 12:45   Re: Proofreading
Reply With Quote #3

Also, I just noticed your cs_set_user_bpammo() call. I don't think it will allow you to add more than 1 HE grenade to the person's backpack. You'll have to catch when it's thrown and then give the user another one.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-20-2009 , 13:18   Re: Proofreading
Reply With Quote #4

Quote:
Originally Posted by Hawk552 View Post
Also, I just noticed your cs_set_user_bpammo() call. I don't think it will allow you to add more than 1 HE grenade to the person's backpack. You'll have to catch when it's thrown and then give the user another one.
You can set as many HE as you want

About avoiding the "new" operator, i don't think you can for arrays.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 17:40.


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