Raised This Month: $ Target: $400
 0% 

Call Of Duty Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-02-2010 , 18:12   Re: Call Of Duty Mod
Reply With Quote #1

Fixed It
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Last edited by linkosc; 07-02-2010 at 20:41. Reason: No Need for this here now
linkosc is offline
Send a message via AIM to linkosc
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-02-2010 , 20:41   Re: Call Of Duty Mod
Reply With Quote #2

NVM I Fixed my Class change Issue after 2 days of working on it 0_o OMG it was so retarded. I dont understand but I already tried what I did to fix it and it didnt work the first time lol but now it works Crazy. Oh well I am going to move on into the perks system.

I just noticed while testing that my Ranks are not working correctly. I am currently a LVL 7 and its saying my rank is a Private First Class II? It was working but now I noticed that my rank has reset. Anyone know how to fix this?
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-02-2010 , 22:05   Re: Call Of Duty Mod
Reply With Quote #3

Your use of include files makes no sense. Just put all code in the same file.
__________________
fysiks is offline
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-04-2010 , 08:16   Re: Call Of Duty Mod
Reply With Quote #4

I did that to seperate it so it has better readability and for each part of the mod that I want to optimize will make it better to locate what im looking for. I plan on this being a really big mod. EX: warcraft has like 19 Inline files because its such a big mod. SO it makes it easier for users to customize to there liking. This was my exact thought. Maybe not everyone would like my mod ust the way it is and so they might want to change it around... IDK
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-04-2010 , 17:57   Re: Call Of Duty Mod
Reply With Quote #5

Quote:
Originally Posted by linkosc View Post
I did that to seperate it so it has better readability and for each part of the mod that I want to optimize will make it better to locate what im looking for. I plan on this being a really big mod. EX: warcraft has like 19 Inline files because its such a big mod. SO it makes it easier for users to customize to there liking. This was my exact thought. Maybe not everyone would like my mod ust the way it is and so they might want to change it around... IDK
I just hate it because it would require me to download/create several files for one plugin. Too much work for me.
__________________
fysiks is offline
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-08-2010 , 04:51   Re: Call Of Duty Mod
Reply With Quote #6

Does anybody have an idea how i can do this?
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-06-2010 , 20:37   Re: Call Of Duty Mod
Reply With Quote #7

Hello Again. Im not to familar with Hud Messages. Instead of typing /class i would like for a Hud Msg to Display the users class/level/xp for every round througout the whole round. Here is the Main Script

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>
#include <nvault>
#include "cod4/Menu.inl"
 
#define PLUGIN "COD4"
#define VERSION "1.0"
#define AUTHOR "<GT>LINK"
#define MAXCLASSES 6
#define MAXRANK 55
 
new PlayerRank[33]
new 
PlayerXP[33]
new 
PlayerLevel[33]
new 
g_vault
new g_msgStatusIcon
new const CLASSES[MAXCLASSES][] = {
    
"None",
    
"Assault",
    
"Spec Ops",
    
"Heavy Gunner",
    
"Demolitions",
    
"Sniper"
}
new const 
RANK[MAXRANK][] = {
    
"Private First Class",
    
"Private First Class I",
    
"Private First Class II"
    
"Lance Corporal"
    
"Lance Corporal I",
    
"Lance Corporal II"
    
"Corporal"
    
"Corporal I",
    
"Corporal II"
    
"Sargeant",
    
"Sargeant I"
    
"Sargeant II"
    
"Staff Sargeant"
    
"Staff Sargeant I"
    
"Straff Sargeant II",
    
"Gunnery Sargeant"
    
"Gunnery Sargeant I"
    
"Gunnery Sargeant II"
    
"Master Sargeant",
    
"Master Sargeant I",
    
"Master Sargeant II",
    
"Master Gunnery Sergeant"
    
"Master Gunnery Sergeant I"
    
"Master Gunnery Sergeant II",
    
"2nd Lieutenant",
    
"2nd Lieutenant I",
    
"2nd Lieutenant II"
    
"1st Lieutenant"
    
"1st Lieutenant I"
    
"1st Lieutenant II"
    
"Captain",
    
"Captain I"
    
"Captain II"
    
"Major"
    
"Major I"
    
"Major II",
    
"Lt. Colonel",
    
"Lt. Colonel I",
    
"Lt. Colonel II",
    
"Colonel",
    
"Colonel I"
    
"Colonel II"
    
"Brigadier General",
    
"Brigadier General I",
    
"Brigadier General II"
    
"Major General",
    
"Major General I"
    
"Major General II",
    
"Lieutenant General",
    
"Lieutenant General I",
    
"Lieutenant General II"
    
"General",
    
"General I"
    
"General II"
    
"Commander"
}
new 
msgtext
new const LEVELS[55] = {
    
0,
    
30
    
120
    
270
    
480
    
750
    
1080,
    
1470,
    
1920,
    
2430,
    
3000,
    
3650,
    
4380,
    
5190,
    
6080,
    
7050,
    
8100,
    
9230
    
10440,
    
11730,
    
13100,
    
14550,
    
16080,
    
17690,
    
19380,
    
21150,
    
23000,
    
24930,
    
26940,
    
29030,
    
31240,
    
33570,
    
36020,
    
38590,
    
41280,
    
44090,
    
47020,
    
50070,
    
53240,
    
56530,
    
59940,
    
63470,
    
67120,
    
70890,
    
74780,
    
82920,
    
87170,
    
91540,
    
96030,
    
100640,
    
105370,
    
110220,
    
115190,
    
120280
}
public 
plugin_init() {
 
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
register_cvar("sv_cod4""1")
 
    
register_event("DeathMsg""DeathMsg""a")
 
    
register_cvar("XP_per_kill""30"
    
register_cvar("XP_Bomb""15"
    
register_cvar("XP_BDefuse""15"
    
register_cvar("XP_Xplode""20"
    
register_cvar("Min_players_XP""1"
    
register_cvar("XP_HS""10"
    
register_cvar("SaveXP","1")
    
g_vault nvault_open("cod4")
 
 
    
register_menucmd(register_menuid("menu_ChooseClass"),1023,"DoChooseClass");
    
register_menucmd(register_menuid("menu_MainMenu"),1023,"v2_MainMenu");
    
register_menucmd(register_menuid("menu_ChangeClass"),1023"v_ChangeClass");
    
register_event("ResetHUD""ResetHud""b"
    
msgtext get_user_msgid("StatusText"
    
g_msgStatusIcon get_user_msgid("StatusIcon")
    
register_message(g_msgStatusIcon"msgStatusIcon")
    
RegisterHam(Ham_Spawn"player""HamPlayerSpawnPost"1)
    
/*RegisterHam(Ham_Spawn, "player", "ChangeClass", 1)*/
    
register_clcmd("say /codmenu""v_MainMenu")
    
register_clcmd("say /changeclass""ChangeClass")
    
register_clcmd("say_team /changeclass""ChangeClass")
    
register_clcmd("say /class""ShowClass")
    
register_clcmd("say /rank""ShowRank")
}
 
public 
msgStatusIcon(msgidmsgdestid) {
 
    static 
szIcon[8];
    
get_msg_arg_string(2szIcon7);
 
    if(
equal(szIcon"buyzone") && get_msg_arg_int(1)) {
 
        
set_pdata_int(id235get_pdata_int(id235) & ~(1<<0));
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
SaveData(id) {
 
    new 
AuthID[35];
    
get_user_authid(id,AuthID,34)
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#%i#",PlayerXP[id],PlayerLevel[id],PlayerRank[id])
    
nvault_set(g_vault,vaultkey,vaultdata)
    return 
PLUGIN_CONTINUE
}
public 
LoadData(id) {
 
    new 
AuthID[35]
    
get_user_authid(id,AuthID,34)
 
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#%i#",PlayerXP[id],PlayerLevel[id],PlayerRank[id])
    
nvault_get(g_vault,vaultkey,vaultdata,255)
 
    
replace_all(vaultdata255"#"" ")
 
    new 
playerxp[32], playerlevel[32], playerrank[32];
 
    
parse(vaultdataplayerxp31playerlevel31)
 
    
PlayerXP[id] = str_to_num(playerxp)
    
PlayerLevel[id] = str_to_num(playerlevel)
    
PlayerRank[id] = str_to_num(playerrank)
 
    return 
PLUGIN_CONTINUE
}
public 
client_connect(id) {
 
    if(
get_cvar_num("SaveXP") == 1) {
 
 
        
LoadData(id)
        
client_print(idprint_chat"[Call of Duty 4] XP Loaded!")
        
client_print(idprint_chat"[Call of Duty 4] You are a %s with level %s and %s XP"PlayerClass[id], PlayerLevel[id], PlayerXP[id], PlayerRank[id])
    }
 
}
public 
client_disconnect(id) {
 
    if(
get_cvar_num("SaveXP") == 1) {
 
 
        
SaveData(id)
    }
}
public 
ResetHud(id) {
 
    if(
PlayerClass[id] == CLASS_NOTHING) {
 
 
        
ChooseClass(id)
        return 
PLUGIN_HANDLED
    
}
 
    return 
PLUGIN_HANDLED
}
public 
DeathMsg() {
 
    if(
get_cvar_num("sv_cod4") == 0) {
 
        return 
PLUGIN_HANDLED
    
}
 
    if(
get_playersnum() < get_cvar_num("Min_players_XP")) {
 
        return 
0;
    }
    new 
attacker read_data(1)
    new 
headshot read_data(3)
 
    if(
PlayerClass[attacker] == CLASS_NOTHING) {
        return 
PLUGIN_HANDLED
    
}
    if(
PlayerLevel[attacker] == 50) {
        return 
PLUGIN_HANDLED
    
}
 
    
PlayerXP[attacker] += get_cvar_num("XP_per_kill")
    if(
headshot)
        
PlayerXP[attacker] += get_cvar_num("XP_HS")
    if(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {
        
PlayerLevel[attacker] += 1
        client_print
(attackerprint_chat"[Call of Duty 4] Congratulations! You are now level %i!"PlayerLevel[attacker])
        if(
get_cvar_num("SaveXP") == 1) {
            
SaveData(attacker)
        }
 
        
ShowHUD(attacker)
    }
 
    
ShowHUD(attacker)
    return 
PLUGIN_CONTINUE
}
public 
ShowHUD(id) {
 
    new 
HUD[51]
    
format(HUD50"[%s]Level: %i XP: %i"RANK[PlayerClass[id]], PlayerLevel[id], PlayerXP[id], PlayerRank[id]) 
    
message_begin(MSG_ONEmsgtext, {0,0,0}, id
    
write_byte(0
    
write_string(HUD
    
message_end() 
    return 
PLUGIN_CONTINUE
}
public 
ShowClass(id) {
 
    new 
HUDS[61]
    
format(HUDS60"[%s]Level: %i XP: %i"CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id], PlayerRank[id])
 
    
message_begin(MSG_ONEmsgtext, {0,0,0}, id)
    
write_byte(0)
    
write_string(HUDS)
    
message_end()
    return 
PLUGIN_CONTINUE
}
public 
ShowRank(id) {
 
    new 
HUDD[71]
    
format(HUDD70"[%s]Level: %i XP: %i"RANK[PlayerClass[id]], PlayerLevel[id], PlayerXP[id], PlayerRank[id])
 
    
message_begin(MSG_ONEmsgtext, {0,0,0}, id)
    
write_byte(0)
    
write_string(HUDD)
    
message_end()
    return 
PLUGIN_HANDLED

Also Note That A variable is used here that is not listed (PlayerClass) it is called in Menus.inl Can someone plz help me with this.
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-08-2010 , 06:20   Re: Call Of Duty Mod
Reply With Quote #8

you can set a task to show it, and remove it when the round is over
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-08-2010 , 13:13   Re: Call Of Duty Mod
Reply With Quote #9

Holy shit, remove the if's and use switch please!
PattyBiena is offline
linkosc
Senior Member
Join Date: Apr 2007
Location: Everywhere
Old 07-08-2010 , 15:26   Re: Call Of Duty Mod
Reply With Quote #10

I already tried to remove the If's and use switch I keep confusing my self and Im not sure how it should properly be done. For the Set Task let me give an Example and tell me if Im correct or not....

EX:
PHP Code:
/*Remove the Client_Print(blablabla); and Add*/
set_task(2.0"Player_Hud");
 
public 
Player_Hud(id) {
          
set_hudmessage(255000.00.9006.0300.0)
          
show_hudmessage(id"[%s]Level: %i XP: %i"CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id], PlayerRank[id]")
           }

Will this work? did I do that right someone please help
__________________
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
linkosc is offline
Send a message via AIM to linkosc
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 14:53.


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