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

Scoutz Knivez [Updated 01/16/10] v1.9


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-05-2009 , 15:31   Scoutz Knivez [Updated 01/16/10] v1.9
Reply With Quote #1

This is a plugin for scoutz knviez maps or any other map! (This is my first mod so please give some support )

Info:
*There are 5 classes to choose from
*You use money to change classes
*Players atuo respawn and get differnt guns according to their class
*theres a shop
*Very fun for scoutz knivez maps.
*Players buy and swich classes with money
*You can edit the prices of items in teh shop buy using cvars

Cvars:
sk_class_cost- Chanegs the vost for players to change class [its set on $1000]
sv_gravity- Changes the ammount of gravity for everyone on the server
sk_armor_cost- Changes the cost of armor in shop.
sk_gravity_cost- Changes the cost of gravity in shop.
sk_grenadepack_cost- Changes the cost of Grenade Pakc in shop.
sk_health_cost- Changes the cost of health in shop.
sk_dealge_cost- Changes the cost of deagle in shop.
sk_invisble_cost- Changes the cost of invisble in shop.
sk_invis_time- Changes the time of being invisble.
sk_deagle_hit_bonus- Changes damage ammount.

Commands:
/class- to swhich a class $1000 to do so.
/skme- to see your name, class, and kills .
/shop- to see the shop

SHOP:
100 Armor for $1000
0.3 [300] Gravity for $1500
Greande pack: $5000 [Comes with all 3 grenades]
More Health: $6000 [250 HP]
Super Deagle: $14000
Invisble: $8000 [Makes the palyer be invsible for 10 secs, you can change cvar]

Classes:
*Scout Big [Has 250 HP]
*Scout Speed [Has 70 HP, gose fast]
*Scout Gravity [has low gravity, 0.2]
*Scout Grenade [Has 3 grenades and low grav]
*Scout Elite [Has armor, good HP]

My Testserver:
[DOWN]

Chain Log:
v0.1 Release
v0.2 fixed some code
v0.3 Fixed stlye of code and added a cvar
v0.4 lazerev fixed code and added money for classes.
v0.5 i added a shop.
v0.6 added new cvar and grenadepack
v0.7 fixed some code.
v0.8 added Health to shop
v0.9 Fixed some code from help
v1.0 Fixed code somewhere ._.
v1.1 Fixed classes enum thigny thanks to someone i forgot the name o well ty.
v1.2 Added deagle to shop for $14000
v1.3 Added cost cvars for shop menu and fixed code thanks to laziboi72
v1.4 Added invsible to shop and cvars. Fixed code nicer.
v1.5 Fixed invisible code.
v1.6 Fixed cvar erros and ShopMenu.
v1.7 Fixed Shop Menu
v1.8 Fixed invsible code
v1.9 Added Super Deagle

Credits:
grimvh2 for some help with the code.
lazarev for very big help on making the code better! and also to make my shop better :S
laziboi72 For helping a bunch with cvar
IneedHelp for fixing shop menu.

Bugs:
*none so far

WHAT TO DO:
Add more items to shop.
I need someone to do screenshots or video of this mod.

Any tips or problems? reply please.
Attached Files
File Type: sma Get Plugin or Get Source (scoutzknivez.sma - 1691 views - 11.5 KB)
__________________

Last edited by Zombiezzz; 03-13-2010 at 22:31.
Zombiezzz is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-05-2009 , 15:43   Re: Scoutz Knivez Class Mod
Reply With Quote #2

Don't use fm_give_item , use give_item from fun module
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 12-05-2009 , 15:46   Re: Scoutz Knivez Class Mod
Reply With Quote #3

Big mod thingy...

Interesting.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 12-05-2009 , 15:51   Re: Scoutz Knivez Class Mod
Reply With Quote #4

Use switch(PlayerClass[id]) at
Code:
public Scout_Spawn(id)  
{
    if (PlayerClass[id] == CLASS_SCOUT_BIG)
         {             //
    fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
         }
         
    if (PlayerClass[id] == CLASS_SCOUT_SPEED)
         {             //
         fm_give_item(id, "weapon_scout");
         fm_give_item(id, "weapon_knife");
         }
         
    if (PlayerClass[id] == CLASS_SCOUT_GRAVITY)
         {             //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
         }
     
    if (PlayerClass[id] == CLASS_SCOUT_GRENADE)
         {             //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
    fm_give_item(id, "weapon_hegrenade");
         }
    if (PlayerClass[id] == CLASS_SCOUT_ELITE)
    {            //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
    }
}
I dont even see why the first 3 and the last is neccesary, you automaticly get a scout and a knife on those maps.

You can optimaze the creating of your menu by using const CLASSES.

At my opinion you take codes of other plugins and/or tutorials without knowing how it works.
__________________
I am out of order!
grimvh2 is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-05-2009 , 15:59   Re: Scoutz Knivez Class Mod
Reply With Quote #5

Quote:
Originally Posted by grimvh2 View Post
Use switch(PlayerClass[id]) at
Code:
public Scout_Spawn(id)  
{
    if (PlayerClass[id] == CLASS_SCOUT_BIG)
         {             //
    fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
         }
 
    if (PlayerClass[id] == CLASS_SCOUT_SPEED)
         {             //
         fm_give_item(id, "weapon_scout");
         fm_give_item(id, "weapon_knife");
         }
 
    if (PlayerClass[id] == CLASS_SCOUT_GRAVITY)
         {             //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
         }
 
    if (PlayerClass[id] == CLASS_SCOUT_GRENADE)
         {             //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
    fm_give_item(id, "weapon_hegrenade");
         }
    if (PlayerClass[id] == CLASS_SCOUT_ELITE)
    {            //
         fm_give_item(id, "weapon_scout");
    fm_give_item(id, "weapon_knife");
    }
}
I dont even see why the first 3 and the last is neccesary, you automaticly get a scout and a knife on those maps.

You can optimaze the creating of your menu by using const CLASSES.

At my opinion you take codes of other plugins and/or tutorials without knowing how it works.
I added it so a person can use anymap they want for this mod -.- not all maps give u a socut..... like maps de_rats

anyways ty for the code.
__________________

Last edited by Zombiezzz; 12-05-2009 at 16:03.
Zombiezzz is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 12-05-2009 , 16:13   Re: Scoutz Knivez Class Mod
Reply With Quote #6

Quote:
Originally Posted by Zombiezzz View Post
This if a plugin for scoutz knviez (SK) maps.
owned
By saying that, I was right.
but anyway you should atleast make cvars.
__________________
I am out of order!
grimvh2 is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-05-2009 , 16:15   Re: Scoutz Knivez Class Mod
Reply With Quote #7

lol you were right >.> ok ill try to make cravs, i havn't gotten it down yet D:
__________________
Zombiezzz is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-09-2009 , 23:18   Re: Scoutz Knivez Class Mod
Reply With Quote #8

UPDATE: i added a crav and i fixed the code so its neet.
__________________
Zombiezzz is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 12-10-2009 , 11:07   Re: Scoutz Knivez Class Mod
Reply With Quote #9

PHP Code:
fm_give_item 
->
PHP Code:
give_item 
if you use fun module.

PHP Code:
register_event("ResetHUD","Scout_Spawn""be"
->
PHP Code:
RegisterHam(Ham_Spawn"player""Scout_Spawn"1
if you use hamsandwich module

[EDIT] check this code, I optimized it a bit, and added cvar for how much does class change costs
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich> 
 
#define PLUGIN "Scoutz Knivez"
#define AUTHOR "Zombiezzz"
#define VERSION "1.2"

#define MAXCLASSES 6

#define CLASS_NOTHING 0
#define CLASS_SCOUT_BIG 1
#define CLASS_SCOUT_SPEED 2
#define CLASS_SCOUT_GRAVITY 3
#define CLASS_SCOUT_GRENADE 4
#define CLASS_SCOUT_ELITE 5

new PlayerClass[33]
new 
g_pClassMoney;

new const 
CLASSES[MAXCLASSES] [] = {
    
"None",
    
"Scout Big",
    
"Scout Runner",
    
"Scout Gravity",
    
"Scout Grenade",
    
"Scout Elite"
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
RegisterHamHam_Spawn"player""Select_Class"
    
    
g_pClassMoney register_cvar("sk_class_cost""1337")
 
    
register_clcmd("say /class""Change_Class")
    
register_clcmd("say_team /class""Change_Class")
    
register_clcmd("say /skme""ShowInfo")
    
register_clcmd("say_team /skme""ShowInfo")
    
    
register_event("CurWeapon""CheckSpeed""be");
}

public 
Change_Class(id)
{
    new 
money get_pcvar_num(g_pClassMoney);
    if( (
PlayerClass[id] == CLASS_NOTHING) || ( cs_get_user_moneyid ) < money ) ) {
        
client_print(idprint_chat"[Scoutz Knivez] You can't change your class right now!")
        return 
PLUGIN_HANDLED;
    }
    else 
    {
        
cs_set_user_moneyidcs_get_user_moneyid ) - money )
        
PlayerClass[id] = CLASS_NOTHING
        client_print
(idprint_chat"[Scoutz Knivez] You can choose your class at next round!")
    }
    return 
PLUGIN_HANDLED;
}

public 
CheckSpeed(id) {
    if(
is_user_alive(id))
    {
        if(
PlayerClass[id] == CLASS_SCOUT_SPEED)
        
set_user_maxspeed(id400.0);
    }
}

public 
ShowInfo(id

    new 
name[33]
    
get_user_name(idname32)
    
    
set_hudmessage(025500.45, -0.1007.03.0)
    
show_hudmessage(id"Name: %s^nClass: %s^nKills: %i",name,CLASSES[PlayerClass[id]],get_user_frags(id))
}  
 
public 
Class_Handle(id menu item

    if(
item == MENU_EXIT
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 

    new 
szCommand[6] , szName[64]; 
    new 
access callback

    
menu_item_getinfo(menu item access szCommand szName 63 callback); 

    new 
num str_to_num(szCommand
  
    if( 
PlayerClass[id] == num 
    { 
        
client_print(id,print_chat,"[Scoutz Knivez] You are alredy a %s",CLASSES[num]) 
    } 
    else 
    {
        switch( 
num 
        { 
            case 
1
            { 
                
give_sk_items(id);
                
set_user_health(id250)
            } 
            case 
2
            { 
                
give_sk_items(id);
                
set_user_health(id70)
                
cs_set_user_bpammo(idCSW_SCOUT60)
            } 
            case 
3
            { 
                
give_sk_items(id);
                
set_user_gravity(id0.2)
                
cs_set_user_bpammo(idCSW_SCOUT60)
            } 
            case 
4:
            {
                
give_sk_items(id);
                
give_item(id"weapon_hegrenade")
                
set_user_gravity(id0.4)
                
set_user_health(id50)
                
cs_set_user_bpammo(idCSW_HEGRENADE3)
            }
            case 
5
            { 
                
give_sk_items(id);
                
set_user_health(id140)
                
set_user_armor(id100)
                
set_user_gravity(id0.5)
                
cs_set_user_bpammo(idCSW_SCOUT90)
            } 
        }

        
PlayerClass[id] = num 
        client_print
(id,print_chat,"[Scoutz Knivez] You are now %s",CLASSES[num]) 
    } 
    
menu_destroy(menu); 
    return 
PLUGIN_CONTINUE 
}  

public 
Select_Class(id)  
{
    if(
is_user_alive(id)) {
        
give_sk_items(id)
        if (
PlayerClass[id] == CLASS_SCOUT_BIG)
        {
            
set_user_health(id250)
        }
        if (
PlayerClass[id] == CLASS_SCOUT_SPEED)
        {
            
set_user_health(id70)
            
cs_set_user_bpammo(idCSW_SCOUT60)
        }
        if (
PlayerClass[id] == CLASS_SCOUT_GRAVITY)
        {
            
set_user_gravity(id0.2)
            
cs_set_user_bpammo(idCSW_SCOUT60)
        }
        if (
PlayerClass[id] == CLASS_SCOUT_GRENADE)
        {
            
give_item(id"weapon_hegrenade")
            
set_user_gravity(id0.4)
            
set_user_health(id50)
            
cs_set_user_bpammo(idCSW_HEGRENADE3)
        }
        if (
PlayerClass[id] == CLASS_SCOUT_ELITE)
        {
            
set_user_health(id140)
            
set_user_armor(id100)
            
set_user_gravity(id0.5)
            
cs_set_user_bpammo(idCSW_SCOUT90)
        }
        if (
PlayerClass[id] == CLASS_NOTHING)
        {
            new 
menu menu_create("Select your class" "Class_Handle");
            
menu_additem(menu ,"Scout Big""1" 0); 
            
menu_additem(menu ,"Scout Runner""2" 0); 
            
menu_additem(menu ,"Scout Gravity""3" 0); 
            
menu_additem(menu ,"Scout Grenade""4" 0);
            
menu_additem(menu ,"Scout Elite""5" 0);
        
            
menu_setprop(menu MPROP_EXIT MEXIT_ALL);
    
            
menu_display(id menu 0); 
            return 
PLUGIN_CONTINUE
        }    
    }
    return 
PLUGIN_HANDLED;
}

stock give_sk_items(id)
{
    
strip_user_weapons(id);
    
give_item(id"weapon_scout");
    
give_item(id"weapon_knife");
    
cs_set_user_bpammo(idCSW_SCOUT20);


Last edited by lazarev; 12-10-2009 at 13:07.
lazarev is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-10-2009 , 15:40   Re: Scoutz Knivez Class Mod
Reply With Quote #10

WOW thank you so much for your code! im going to try ot make a shop for the money. I will add you name in the threads name so people know you made most of the mod :S
__________________
Zombiezzz 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 13:02.


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