Raised This Month: $ Target: $400
 0% 

Animal Xp with changing model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 04-18-2005 , 15:15  
Reply With Quote #3

I got it to work when i did this:
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define CLASS_NOTHING 0 #define CLASS_DOG 1 #define CLASS_CAT 2 #define CLASS_HORSE 3 #define CLASS_COW 4 #define MAXCLASSES 5 new PlayerClass[33] new PlayerXP[33] new PlayerLevel[33] new const CLASSES[MAXCLASSES][] = {     "None",     "Dog",     "Cat",     "Horse",     "Cow" } new msgtext new const LEVELS[6] = {     100,     200,     400,     800,     1600,     3200 } public plugin_init() { //registers important things     register_plugin("Animal Mod", "1.0", "XunTric")     register_cvar("sv_animalmod", "1")     register_event("DeathMsg", "DeathMsg", "a")     register_cvar("XP_per_kill", "20")     register_menucmd(register_menuid("menu_ChooseAnimal"),1023,"DoChooseAnimal");     register_event("ResetHUD", "ResetHud", "b")     msgtext = get_user_msgid("StatusText")     register_clcmd("say /changeanimal", "ChangeAnimal")     register_clcmd("say_team /changeanimal", "ChangeAnimal") } stock ChooseAnimal(id) {     new menu[192]     new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0;         format(menu, 191, "Animal Mod: Choose Animal^n^n1. Dog^n2. Cat^n3. Horse^n4. Cow^n^n0. Exit")     show_menu(id, keys, menu, -1, "menu_ChooseAnimal")         return PLUGIN_CONTINUE } public DoChooseAnimal(id, key) {     if(key == 0) {                  if(PlayerClass[id] == CLASS_DOG) {                         client_print(id, print_chat, "[Animal Mod] You are allready a Dog! Choose something else!")               ChooseAnimal(id)                         return PLUGIN_HANDLED          }                  PlayerClass[id] = CLASS_DOG                  client_print(id, print_chat, "[Animal Mod] You are now a Dog!")          precache_model("models/animals/dog.mdl");     }                       if(key == 1) {                    if(PlayerClass[id] == CLASS_CAT) {                             client_print(id, print_chat, "[Animal Mod] You are allready a Cat! Choose something else!")               ChooseAnimal(id)               return PLUGIN_HANDLED          }                              PlayerClass[id] = CLASS_CAT          client_print(id, print_chat, "[Animal Mod] You are now a Cat!")     }         if(key == 2) {                    if(PlayerClass[id] == CLASS_HORSE) {                             client_print(id, print_chat, "[Animal Mod] You are allready a Horse! Choose something else!")               ChooseAnimal(id)               return PLUGIN_HANDLED          }                              PlayerClass[id] = CLASS_HORSE          client_print(id, print_chat, "[Animal Mod] You are now a Horse!")     }         if(key == 3) {                    if(PlayerClass[id] == CLASS_COW) {                             client_print(id, print_chat, "[Animal Mod] You are allready a Cow! Choose something else!")               ChooseAnimal(id)               return PLUGIN_HANDLED          }                              PlayerClass[id] = CLASS_COW          client_print(id, print_chat, "[Animal Mod] You are now a Cow!")     }           ShowHUD(id)         return PLUGIN_HANDLED } public ResetHUD(id) {     if(PlayerClass[id] == CLASS_NOTHING) {              ChooseAnimal(id)          return PLUGIN_HANDLED     }         return PLUGIN_HANDLED } public DeathMsg() {     if(get_cvar_num("sv_animalmod") == 0) {          return PLUGIN_HANDLED     }         new attacker = read_data(1)         if(PlayerClass[attacker] == CLASS_NOTHING) {          return PLUGIN_HANDLED     }         if(PlayerLevel[attacker] == 6) {          return PLUGIN_HANDLED     }                 PlayerXP[attacker] += get_cvar_num("XP_per_kill")         if(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {                PlayerLevel[attacker] += 1                    client_print(attacker, print_chat, "[Animal Mod] Congratulations! You are now level %i!", PlayerLevel[attacker])                    ShowHUD(attacker)     }           ShowHUD(attacker)         return PLUGIN_CONTINUE } public ShowHUD(id)     {     new HUD[51]     format(HUD, 50, "[%s]Level: %i XP: %i", CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id])     message_begin(MSG_ONE, msgtext, {0,0,0}, id)     write_byte(0)     write_string(HUD)     message_end()     return }
I don't know if it will change model though bc I haven't tested the plugin i just got it to compile.

Xuntric is it ok if i add multilanguage and sql or vault and such things and make it a plugin. I will of course give you credits.
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
 



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 09:58.


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