You are viewing our Forum Archives. To view or take place in current topics click here.
How to add a verification system [MW2]
Posted:

How to add a verification system [MW2]Posted:

TeOz_CoDy
  • Powerhouse
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
Hello TTG, today I will be showing you how to add a verification system to your mod menu.

Step 1:
First you need to add this into your declarations
bool Verified[18];
bool UnVerified[18];
bool Admin[18];
int selectedClient[18];


Step 2:
Add GetPlayerName to the source
const char *GetPlayerName(int client)
{
   DWORD player;
   player = plAyerState(client);
   player += 0x44;
   return (char*)player;
}


Step 3:
Add this for when player/player's are in-game (under cl_ingame)
if(i != 0)
{
    Admin[i] = false;
    Verified[i] = false;
    UnVerified[i] = true;
    break;
}
    Admin[0] = true; //This allows only the host to use the menu until player's verified
}


Step 4:
Add this for menu open (so if player is un-verified menu is not available)
if(Verified[i] == true)
{


Step 5:
This will show the player's that are in your game
setText(Text2[i], (char*)GetPlayerName(1), 4, 1.70, 520, 116, 1, 0x2);
setText(Text3[i], (char*)GetPlayerName(2), 4, 1.70, 520, 116+(20.55*1), 1, 0x2);
ect...


Step 6:
Then do this to verify a player
if(!Verified[selectedClient[i]])
{
    Admin[selectedClient[i]] = false;
    Verified[selectedClient[i]] = true;
    SV(i, 1, "c \"Player: Verified\"");
    break;
}
else
{
    SV(i, 1, "c \"Player Already Verified\"");
    break;
}


Sorry if this doesn't make much sense I will make it a bit more clear tomorrow.

The following 7 users thanked TeOz_CoDy for this useful post:

The-Rev (05-14-2013), Botch (05-13-2013), SimbaXe (05-13-2013), Xenon_Hoster (05-13-2013), TU7Leo (05-12-2013), Snooop (05-12-2013), Adamu (05-12-2013)
#2. Posted:
Adamu
  • Christmas!
Status: Offline
Joined: Feb 02, 201311Year Member
Posts: 5,477
Reputation Power: 335
Status: Offline
Joined: Feb 02, 201311Year Member
Posts: 5,477
Reputation Power: 335
Looks good bro this will help me when i start to make my tu8 mod menu
#3. Posted:
chrispro1994
  • Powerhouse
Status: Offline
Joined: Jan 03, 201113Year Member
Posts: 408
Reputation Power: 17
Status: Offline
Joined: Jan 03, 201113Year Member
Posts: 408
Reputation Power: 17
Any credit to me...?
I basically told you everything.
#4. Posted:
TeOz_CoDy
  • Powerhouse
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
chrispro1994 wrote Any credit to me...?
I basically told you everything.
I didn't use what you sent me Restxrt gave me most of it then me and Chaotic fixed it and added more to it.
#5. Posted:
hacksorce
  • Challenger
Status: Offline
Joined: Aug 17, 201211Year Member
Posts: 132
Reputation Power: 8
Status: Offline
Joined: Aug 17, 201211Year Member
Posts: 132
Reputation Power: 8
did people really not know how to do this? It is just checking if a bool is true of false. And also the admin is not always 0 so you will need another way of checking for the host. But, now people know this. I guess that this will help some people, who knows.
#6. Posted:
TeOz_CoDy
  • Powerhouse
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
Status: Offline
Joined: Jan 13, 201212Year Member
Posts: 439
Reputation Power: 23
hacksorce wrote did people really not know how to do this? It is just checking if a bool is true of false. And also the admin is not always 0 so you will need another way of checking for the host. But, now people know this. I guess that this will help some people, who knows.
I had a lot of people asking me how to do it.
#7. Posted:
SimbaXe
  • Gold Gifter
Status: Offline
Joined: Dec 22, 201112Year Member
Posts: 2,821
Reputation Power: 143
Status: Offline
Joined: Dec 22, 201112Year Member
Posts: 2,821
Reputation Power: 143
Thanks for this this real really help me out with my menu
#8. Posted:
SketchyVI
  • Challenger
Status: Offline
Joined: Nov 25, 201211Year Member
Posts: 165
Reputation Power: 7
Status: Offline
Joined: Nov 25, 201211Year Member
Posts: 165
Reputation Power: 7
Community needs this, Some can also can adapt to it with parts of code, Trial and error.
#9. Posted:
chrispro1994
  • Powerhouse
Status: Offline
Joined: Jan 03, 201113Year Member
Posts: 408
Reputation Power: 17
Status: Offline
Joined: Jan 03, 201113Year Member
Posts: 408
Reputation Power: 17
hacksorce wrote did people really not know how to do this? It is just checking if a bool is true of false. And also the admin is not always 0 so you will need another way of checking for the host. But, now people know this. I guess that this will help some people, who knows.
right? its so simple just like any other thing that you toggle.
#10. Posted:
M0D1F13D
  • TTG Senior
Status: Offline
Joined: Sep 06, 201013Year Member
Posts: 1,069
Reputation Power: 47
Status: Offline
Joined: Sep 06, 201013Year Member
Posts: 1,069
Reputation Power: 47
No need for a Verified and an UnVerified variable. If Verified is true they are, if it's false they aren't.

As someone else said, host isn't always client 0.

It's a good start, it just needs some work.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.