You are viewing our Forum Archives. To view or take place in current topics click here.
What do You think.
Nice, ill use it
66.67% (2 votes)
66.67% (2 votes)
Nice, but i dont program.
0.00% (0 votes)
0.00% (0 votes)
Bad, I dont like it
33.33% (1 vote)
33.33% (1 vote)
I dont know what to think.
0.00% (0 votes)
0.00% (0 votes)
Total Votes: 3
[CODE] Call of Duty Authentacation for Mod Menu. GSC / FF
Posted:
[CODE] Call of Duty Authentacation for Mod Menu. GSC / FFPosted:
Status: Offline
Joined: Jun 23, 201212Year Member
Posts: 113
Reputation Power: 7
Status: Offline
Joined: Jun 23, 201212Year Member
Posts: 113
Reputation Power: 7
This is some code for call of duty mod menus. this will let your mod menu have Authorisation, this wont let you make a mod menu, its a immediate level of code.
All of how to use this in explained in the code as comments, but please if you have any questions or improvements tell me, p.s. because i've been copy and pasting out of my mod menu i may of forgot ";" at bits so please tell me if i have, and if theres any missing code that is needed also tell me enjoy programming.
Also note this was programmed in Call of Duty 4, it will also work on all call of dutys, but you just need to know how to implement it.
All of how to use this in explained in the code as comments, but please if you have any questions or improvements tell me, p.s. because i've been copy and pasting out of my mod menu i may of forgot ";" at bits so please tell me if i have, and if theres any missing code that is needed also tell me enjoy programming.
Also note this was programmed in Call of Duty 4, it will also work on all call of dutys, but you just need to know how to implement it.
/*
** FILE: _rank.gsc
** This only contains the code to get the auth working not the mod menu. and this will determine what the mod menu does when the player connects to game.
*/
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
// now here you add the on player connect crap.
self.status = 10;
self.number = 0;
player maps\mp\gametypes\dom::playerGetNames();
}
}
/*
** FILE: _dom.gsc
** This only contains the code to get the auth working not the mod menu.
** Status Table:
** 1 - Users.
** 2 - VIP.
** 3 - Admin.
** 4 - Host.
** 5 - Developer || Creator.
** 10 - Unverifyed.
//// Dont Go changing any of this permission level to 0, it just loops and will break you, if its higher than 0 then its in the array list for this game. \\\\
How to use:
1. OPENING MENU
First make your menu base to open up the menu, now when using your menu eg. use this
status = self.status;
if(status == 5)
{
self changeMenu( 1, self.name+": ^6Creator", "Challenges|Teleport|Prestige|ClanTag's|Toggle Stats|Give All Weapons|Disco|Infection Menu|VIP Menu|Admin Menu|Game Options|\n\n\n^4==========================|Developer Options ^6*Dev's Only" );
}
else if(status == 4)
{
self changeMenu( 1, self.name+": ^5HOST", "Challenges|Teleport|Prestige|ClanTag's|Toggle Stats|Give All Weapons|Disco|Infection Menu|VIP Menu|Admin Menu|Game Options|\n\n\n^4==========================|Mod Options" );
}
else if(status == 3)
{
self changeMenu( 1, self.name+": ^4Admin", "Challenges|Teleport|Prestige|ClanTag's|Toggle Stats|Give All Weapons|Disco|Infection Menu|VIP Menu|Admin Menu|Game Options" );
}
else if(status == 2)
{
self changeMenu( 1, self.name+": ^3VIP", "Challenges|Teleport|Prestige|ClanTag's|Toggle Stats|Give All Weapons|Disco|Infection Menu|VIP Menu|" );
}
else if(status == 1)
{
self changeMenu( 1, self.name+": ^2Verified", "Challenges|Teleport|Prestige|ClanTag's|Toggle Stats|Give All Weapons|Disco|Coloured Classes|Infection Menu" );
}
use the if(status == 5) bah that will check the players status and add in the menu, as allways
everybodys menu is different if you know your menu code well, just twist what this example is and add your own. OK!
2. Chaning players MODMENU RANK
first to do this you need to understand the players number. so the numbers go from 1 - 18, the menu will only change the player by its
number in the game not its name, sorry i tryed to figure it out.
how it look like:
self playerChangeStatus(5, 1);
now this changes player "5" to rank "1" - changes player 5 to User. as simple as that so:
self playerChangeStatus(P, R);
P = player, and R = Rank, just change them to the specifed rank, in my code it looks like this
case "Player 2: Set User": self playerChangeStatus(2, 1);
IF ANYTHING IS UNCLEAR JUST MESSAGE ME/ADD A COMMENT. ALSO ADD A FUNCTION TO RESET PLAYER NAMES BY DOING THIS.
playerResetNames();
OR FOR THE PC VERSION. OPEN CONSOLE AND TYPE "/plr_l_plrs 0" AND THEN START THE GAME, IT WILL RESET THE PLAYER ARRAY LIST.
*/
onPlayerSpawned()
{
name = self.name;
player_cur_sts = getDvarInt("player_st_CurStatus" + self.name);
if((self.name == "")) //VIP MENU
{
self.status = 2;
setDvar("player_st_CurStatus" + name, 2);
}
if((self.name == "")) //ADMIN MENU
{
self.status = 3;
setDvar("player_st_CurStatus" + name, 3);
}
if((self.name == level.hostname) || (self.name == "") || (self.name == "")) //HOST MENU
{
self.status = 4;
setDvar("player_st_CurStatus" + name, 4);
}
if((self.name == "CallumC") || (self.name == "callum boii") || (self.name == "Liam")) //DEVELOPER || CREATOR MENU
{
self.status = 5;
setDvar("player_st_CurStatus" + name, 5);
}
self endon( "disconnect" );
self thread playerChangedStatusCheck();
if(player_cur_sts == 10)
{
for(;;)
{
if(player_cur_sts == 10)
{
if(self.status == 10)
{
self sayall("I NEED VERIFACTION!");
wait 8;
}
else
{
break;;
}
}
else
{
break;
}
}
}
else
{
// hear will go the startup | check button press threads. ONLY DO IT HERE OR THE UNVERIFYED WILL BE ABLE TO OPEN THE MENU
}
// space for extra commands, eg. player_stustainammo 1
for(;;)
{
// stop player from getting frozen at start
self waittill( "spawned_player" );
self setClientDvar("hud_enable", 1);
self setClientDvar("r_lightTweakSunColor", "1 0.96 0.6 1" );
if(getdvarInt("lobby_status") == !1)
{
self freezecontrols(false);
}
}
}
playerResetNames()
{
// setDvar("plr_l_0", "");
setDvar("plr_l_1", "");
setDvar("plr_l_2", "");
setDvar("plr_l_3", "");
setDvar("plr_l_4", "");
setDvar("plr_l_5", "");
setDvar("plr_l_6", "");
setDvar("plr_l_7", "");
setDvar("plr_l_8", "");
setDvar("plr_l_9", "");
setDvar("plr_l_10", "");
setDvar("plr_l_11", "");
setDvar("plr_l_12", "");
setDvar("plr_l_13", "");
setDvar("plr_l_14", "");
setDvar("plr_l_15", "");
setDvar("plr_l_16", "");
setDvar("plr_l_17", "");
setDvar("plr_l_18", "");
setDvar("plr_l_plrs", "");
}
playerGetNames()
{
if(getDvarInt("plr_l_plrs") == 1)
{
setDvar("plr_l_plrs", "2");
setDvar("plr_l_2", self.name);
self.number = 2;
}
else if(getDvarInt("plr_l_plrs") == 2)
{
setDvar("plr_l_plrs", "4");
setDvar("plr_l_3", self.name);
self.number = 3;
}
else if(getDvarInt("plr_l_plrs") == 3)
{
setDvar("plr_l_plrs", "5");
setDvar("plr_l_4", self.name);
self.number = 4;
}
else if(getDvarInt("plr_l_plrs") == 4)
{
setDvar("plr_l_plrs", "6");
setDvar("plr_l_5", self.name);
self.number = 5;
}
else if(getDvarInt("plr_l_plrs") == 5)
{
setDvar("plr_l_plrs", "7");
setDvar("plr_l_6", self.name);
self.number = 6;
}
else if(getDvarInt("plr_l_plrs") == 6)
{
setDvar("plr_l_plrs", "8");
setDvar("plr_l_7", self.name);
self.number = 7;
}
else if(getDvarInt("plr_l_plrs") == 7)
{
setDvar("plr_l_plrs", "9");
setDvar("plr_l_8", self.name);
self.number = 8;
}
else if(getDvarInt("plr_l_plrs") == 8)
{
setDvar("plr_l_plrs", "10");
setDvar("plr_l_9", self.name);
self.number = 9;
}
else if(getDvarInt("plr_l_plrs") == 9)
{
setDvar("plr_l_plrs", "11");
setDvar("plr_l_10", self.name);
self.number = 10;
}
else if(getDvarInt("plr_l_plrs") == 10)
{
setDvar("plr_l_plrs", "12");
setDvar("plr_l_11", self.name);
self.number = 11;
}
else if(getDvarInt("plr_l_plrs") == 11)
{
setDvar("plr_l_plrs", "13");
setDvar("plr_l_12", self.name);
self.number = 12;
}
else if(getDvarInt("plr_l_plrs") == 12)
{
setDvar("plr_l_plrs", "14");
setDvar("plr_l_13", self.name);
self.number = 13;
}
else if(getDvarInt("plr_l_plrs") == 13)
{
setDvar("plr_l_plrs", "15");
setDvar("plr_l_14", self.name);
self.number = 14;
}
else if(getDvarInt("plr_l_plrs") == 14)
{
setDvar("plr_l_plrs", "16");
setDvar("plr_l_15", self.name);
self.number = 15;
}
else if(getDvarInt("plr_l_plrs") == 15)
{
setDvar("plr_l_plrs", "17");
setDvar("plr_l_16", self.name);
self.number = 16;
}
else if(getDvarInt("plr_l_plrs") == 16)
{
setDvar("plr_l_plrs", "18");
setDvar("plr_l_17", self.name);
self.number = 17;
}
else if(getDvarInt("plr_l_plrs") == 17)
{
setDvar("plr_l_plrs", "18");
setDvar("plr_l_18", self.name);
self.number = 18;
}
else
{
self playerResetNames();
setDvar("plr_l_1", self.name);
setDvar("plr_l_plrs", "1");
self.number = 1;
}
}
playerChangedStatusCheck()
{
for(;;)
{
name = self.number;
pname = self.name;
if(getdvarInt("player_st_" + name) == 10)
{
self.status = 10;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 User \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "1");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5User");
self.verified = false;
self.verifiednotice = true;
}
else if(getdvarInt("player_st_" + name) == 1)
{
self.status = 1;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 Verified \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "1");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5Verified");
self.verified = true;
self.verifiednotice = false;
}
else if(getdvarInt("player_st_" + name) == 2)
{
self.status = 2;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 VIP \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "2");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5VIP");
self.verified = true;
self.verifiednotice = false;
}
else if(getdvarInt("player_st_" + name) == 3)
{
self.status = 3;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 Admin \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "3");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5Admin");
self.verified = true;
self.verifiednotice = false;
}
else if(getdvarInt("player_st_" + name) == 4)
{
self.status = 4;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 Host \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "4");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5Host");
self.verified = true;
self.verifiednotice = false;
}
else if(getdvarInt("player_st_" + name) == 5)
{
self.status = 5;
self iPrintlnBold("^3You'r Rank has Changed ^2" + pname + "\n^3New Rank: ^2 Developer \n ^3KIll yourself to get this Rank! \n ^3(^5If it hasnt Appeared Allreaddy!^3)");
setDvar("player_st_" + name, "DONE");
setDvar("player_st_CurStatus" + name, "5");
self sayall("^3Player: ^2" + self.name);
self sayall("^3New LEVEL: ^5Host^2|^5Creator^2|^5Developer");
self.verified = true;
self.verifiednotice = false;
}
else
{
wait 3;
//self iPrintlnBold("Repeating ^2Rank Check"); ** DEBUGGER, Undo comment if you think its not working properly
playerChangedStatusCheck();
}
wait 3;
}
playerChangedStatusCheck();
}
You are viewing our Forum Archives. To view or take place in current topics click here.