AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deagle (https://forums.alliedmods.net/showthread.php?t=120586)

Crazybeer 03-06-2010 11:12

Deagle
 
1 Attachment(s)
Hello,

I'm a newb coder. I'm trying to learn to code.

For now i am trying to add Deagle to Xp Mod v0.0.1

This is what i have done for far.

PHP Code:

#define ENABLE_DEAGLE           1 

PHP Code:

#define MAXLEVEL_DEAGLE        5 

PHP Code:

#define FIRST_XP_DEAGLE        1200 

PHP Code:

#define ANY_ABILITY_ENABLED (g_any_nade_enabled || g_any_health_enabled || g_any_armor_enabled || g_any_respawn_enabled || g_any_nofall_enabled || g_any_deagle_enabled) 

PHP Code:

new const g_any_weapon_enabled ENABLE_TERR_DEAGLE ENABLE_CT_DEAGLE;;
 
new const 
g_deagle_names[CsTeams][] =
{
 
"",
 
"T Deagle Chance",
 
"CT Deagle Chance",
 
""
};
 
new const 
g_deagle_classnames[Deagle][] =
{
 
"weapon_deagle",
};
 
new_const g_deagle_maxlevels[CsTeams] =
{
 
0,
 
MAXLEVEL_TERR_DEAGLE,
 
MAXLEVEL_CT_DEAGLE,
 
0
};
new const 
g_deagle_first_xp[CsTeams] =
{
 
0,
 
FIRST_XP_TERR_DEAGLE,
 
FIRST_XP_TERR_DEAGLE,
 
0
};
new_const g_deagle_chance[CsTeams] =
{
 
0,
 
CHANCE_MAX_TERR_DEAGLE,
 
CHANCE_MAX_CT_DEAGLE,
 
0
}, 

And i don't know what to do so it works.

If you fix it can you send it to private?

Kreation 03-06-2010 12:55

Re: Deagle
 
Quote:

Originally Posted by Crazybeer (Post 1109491)
new const g_deagle_classnames[Deagle][] =
{
weapon_deagle
};



Where did you get the "Deagle" from?

Crazybeer 03-06-2010 13:01

Re: Deagle
 
What u mean?

Is it

PHP Code:

new const g_weapon_classnames[Deagle][] =
{
weapon_deagle
}; 


wrecked_ 03-06-2010 13:09

Re: Deagle
 
PHP Code:

new const g_deagle_classnames[Deagle][] =
{
 
"weapon_deagle",
}; 

:arrow:
PHP Code:

new const g_deagle_classnames[Deagle][] = "weapon_deagle" 


Crazybeer 03-06-2010 13:37

Re: Deagle
 
Quote:

Originally Posted by wrecked_ (Post 1109590)
PHP Code:

new const g_deagle_classnames[Deagle][] =
{
 
"weapon_deagle",
}; 

:arrow:
PHP Code:

new const g_deagle_classnames[Deagle][] = "weapon_deagle" 


But the first option is in Exolents Xp Mod.

So when i change will the Deagle work ?

wrecked_ 03-06-2010 13:38

Re: Deagle
 
I don't know why you didn't get any errors when trying to compile that. You had a comma after a single variable, and usually the compiler warns / errors you about that. It might work.

Crazybeer 03-06-2010 16:43

Re: Deagle
 
wrecked_

The deagle menu wont appear in the Xp Mod menu.

What have i forget?

BunnYboii 03-07-2010 10:13

Re: Deagle
 
Little off-topic but where did ya learn codeing crazybeer i want to learn too :):)

wrecked_ 03-07-2010 10:37

Re: Deagle
 
@Crazybeer - You need to add the deagle to the menu.

PHP Code:

menu_additemmenu"Deagle""integer"


Kreation 03-07-2010 14:42

Re: Deagle
 
Either way it isn't going to work.. You need to tell the plugin what "Deagle" is. You can't put it in an array if it doesn't exist.


All times are GMT -4. The time now is 08:45.

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