Raised This Month: $ Target: $400
 0% 

Zombie Revolution help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Killedbyme
Junior Member
Join Date: Oct 2009
Old 10-21-2009 , 00:49   Zombie Revolution help
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <vault>

#define CLASS_NOTHING 0
#define CLASS_NAVY 1
#define CLASS_MARINE 2
#define CLASS_ARMY 3
#define CLASS_AIRFORCE 4
#define CLASS_ROGUE 5
#define CLASS_BARBARIAN 6
#define CLASS_MYSTIC 7
#define CLASS_ZMEDIC 8

#define MAXCLASSES 9

new PlayerClass[33]
new 
PlayerXP[33]
new 
PlayerLevel[33]

new const 
CLASSES[MAXCLASSES][] = {
     
"None",
     
"Navy",
     
"Marine",
     
"Army",
     
"AirForce",
     
"Rogue",
     
"Barbarian",
     
"Mystic",
     
"Zombie Medic"
}

new 
msgtext

new const LEVELS[10] = {
    
50//50 XP for level 1
    
150//150 XP for level 2
    
200//200 XP for level 3
    
250//250 XP for level 4
    
300//300 XP for level 5
    
350//350 XP for level 6
    
400//400 XP for level 7
    
450//450 XP for level 8
    
500//500 XP for level 9
    
600//600 XP for level 10
}

public 
plugin_init()
{
    
register_plugin("ZR Mod""1.0""DwF Pain is inevitable")
    
    
register_cvar("sv_ZRmod""1")
    
    
register_event("DeathMsg""DeathMsg""a"
    
    
register_cvar("XP_per_kill""15")
    
    
register_menucmd(register_menuid("menu_ChooseClass"),1023,"MenuAction_ChooseClass");
    
    
register_event("ResetHUD""ResetHud""b")
    
    
msgtext get_user_msgid("StatusText"

    
register_clcmd("say /changeanimal""ChangeAnimal")
    
register_clcmd("say_team /changeanimal""ChangeAnimal")
}



stock ChooseClass(id)
{
    new 
menu[192
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3 

    
    format
(menu191"ZR Mod: Choose Class^n^n1. Navy^n2. Marine^n3. Army^n4. AirForce^n^n0. Exit"
    
show_menu(idkeysmenu, -1"menu_ChooseClass")    
    return 
PLUGIN_CONTINUE
}

public 
DoChooseClass(idkey)
{

    if(
key == 0) {
       
         if(
PlayerClass[id] == CLASS_NOTHING) {
         
              
client_print(idprint_chat"[ZR Mod] You are already unenlisted! Join the ranks!")

              
ChooseClass(id)

              return 
PLUGIN_HANDLED
         
}        

         
PlayerClass[id] = CLASS_NOTHING
         
         client_print
(idprint_chat"[ZR Mod] You are no longer in the services!")
    }        

         
    if(
key == 1) {
         
         if(
PlayerClass[id] == CLASS_NAVY) {
              
              
client_print(idprint_chat"[ZR Mod] You are already enlisted in the Navy! Join something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
                   
         
PlayerClass[id] = CLASS_NAVY
         client_print
(idprint_chat"[ZR Mod] You are now enlisted as a Navy Seal!")
    }
    
    if(
key == 2) {
         
         if(
PlayerClass[id] == CLASS_MARINE) {
              
              
client_print(idprint_chat"[ZR Mod] You are already enlisted in the Marine Corp! Join something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
                   
         
PlayerClass[id] = CLASS_MARINE
         client_print
(idprint_chat"[ZR Mod] You are now enlisted as a Marine!")
    }    

    if(
key == 3) {
         
         if(
PlayerClass[id] == CLASS_ARMY) {
              
              
client_print(idprint_chat"[ZR Mod] You are already enlisted in the Army! Join something else!")
              
ChooseClass(id)
              return 
PLUGIN_HANDLED
         
}
                   
         
PlayerClass[id] = CLASS_ARMY
         client_print
(idprint_chat"[ZR Mod] You are now enlisted in the Army!")
    }

      
    
ShowHUD(id)
    
    return 
PLUGIN_HANDLED
}

public 
ResetHUD(id)
{
    if(
PlayerClass[id] == CLASS_NOTHING) {
    
         
ChooseClass(id)
         return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_HANDLED
}

public 
DeathMsg()
{
    if(
get_cvar_num("sv_ZRmod") == 0) {
         return 
PLUGIN_HANDLED
    
}
    
    new 
attacker read_data(1)
    
    if(
PlayerClass[attacker] == CLASS_NOTHING) {
         return 
PLUGIN_HANDLED
    
}
    
    if(
PlayerLevel[attacker] == 10) {
         return 
PLUGIN_HANDLED
    
}
            
    
PlayerXP[attacker] += get_cvar_num("15"
    
    if(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {
     
         
PlayerLevel[attacker] += 1
         
         client_print
(attackerprint_chat"[ZR Mod] Congratulations! You are now level %i!"PlayerLevel[attacker])
         
         
ShowHUD(attacker)
    }   
    
    
ShowHUD(attacker)
    
    return 
PLUGIN_CONTINUE
}

public 
ShowHUD(id)    

    new 
HUD[51]
    
format(HUD50"[%s]Level: %i XP: %i"CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id]) 

    
message_begin(MSG_ONEmsgtext, {0,0,0}, id
    
write_byte(0
    
write_string(HUD
    
message_end() 
    return

Heres what I am trying to achieve. I am trying to make it so CT's select from the Army, Navy, Marines, and Airforce and each class has 3 basic skills and then an ultimate. T's pick from Rogue, Barbarian, Mystic, and zombie medic with the same 3 skills and ultimate for each class. Now next to the players spawn is either armory (ct) or hive (t) and you must touch the hive to change class. Now once the map changes all xp is reset and people start anew. I hope you guys understand what im trying for. ill give you a server ip that has exactly what i want but i cant seem to get the code from so I decided to just build from scratch and make a better one. 69.162.77.228:27015 - This is not my server and i apologize if this seems like advertisement. Its the only server that has what im looking for but i want to improve it.
Killedbyme is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 08:22   Re: Zombie Revolution help
Reply With Quote #2

This is the scripting help section, not suggestions. You should only post here if you actually have some level of scripting experience and just need others to review/comment on/fix your work. No one is going to sit down and spend a few hours writing an entirely new XP mod for you based on an absolutely atrociously-done tutorial as a base.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Killedbyme
Junior Member
Join Date: Oct 2009
Old 10-21-2009 , 11:42   Re: Zombie Revolution help
Reply With Quote #3

very well then. I will continue to fix it up as i have been doing. Quick question. And i guess this could be considered help. How do I make my classes team based?
Killedbyme is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 13:11   Re: Zombie Revolution help
Reply With Quote #4

x_get_user_team()
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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:43.


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