system know who your admin

Started by kennedyarz, Mar 21, 2016, 01:54 AM

Previous topic - Next topic

kennedyarz

hello this time I ask for help with admin level function? you do here? poque put the system / admin cmds player and does not leave anyone? I need help with that security and where I stand that I am admin. ???

Goku

Dude, you are posting in wrong section of the forum for help!!! And Did you visit http://wiki.vc-mp.org. There are plenty of examples for these functions!!!
There is only one thing that i know about life - Some mistakes happen by chance, but some mistakes happen because we make 'em happen.

Goku

And P.S stop making more than one topics for a single subject!!!
There is only one thing that i know about life - Some mistakes happen by chance, but some mistakes happen because we make 'em happen.

Mötley

#3
Explain a little better ???

Edit

I had also told you before to make hidden cmds if you can't fix!

Also I can't help you if i don't know what kind of system you are using(query etc), i suggest uploading one admin cmd to show how the administration system works. you register function login and i doubt you are even returning admin commands as false, return 0 for non admins!

If you can't fix it i would suggest uploading majority of your script Unfortunately, as your entire script for admin system has to be entirely re written!

It's really not that hard. I wrote mine in two minutes took 3 minutes of trying every exploit that i could think of.

#I'm on my phone so expect errors
 
  if (cmd == "ban")
  {
    if ([Account] < 1) {
      AdminCommand(player);
      return true;
    }

Players should never receive levels only admins. Instead of using levels use there password to authorize there account( this is how i achieved it fastly)

You will need to do stroger account management? Took me a while to ensure you can't re register an existing account etc, You will need to delete accounts as passwords are encrypted and would cause possible issues ( or do you encrypt passwords??)

[VM_U]Spectra.PhantoM^

First the class
class PlayerClass
{
Level = 0
}
Then(Note this is to be pasted on onplayerjoin):
stats[ player.ID ] = PlayerClass( player.Name, sqliteDB );Finally(to be pasted on onplayercommand):
else if (cmd == "admins" || cmd == "admin")
{
local plr = GetPlayers();
{
plr = FindPlayer( player.ID );
if ((plr) && ( stats[player.ID].Level = 3))
{
Message("Admins: " + plr.Name + " [" + stats[player.ID].Level + "]");
}
else Message("No Admins Online");
}
}
Its tested and it works.
Wanna Talk To Me? Come At Irc #Jugo@LUNet

DizzasTeR

I can guarantee you that the above code doesn't work.

KAKAN

Quote from: {ultimatejugo] on Apr 04, 2016, 09:52 AMFirst the class
class PlayerClass
{
Level = 0
}
Then(Note this is to be pasted on onplayerjoin):
stats[ player.ID ] = PlayerClass( player.Name, sqliteDB );Finally(to be pasted on onplayercommand):
else if (cmd == "admins" || cmd == "admin")
{
local plr = GetPlayers();
{
plr = FindPlayer( player.ID );
if ((plr) && ( stats[player.ID].Level = 3))
{
Message("Admins: " + plr.Name + " [" + stats[player.ID].Level + "]");
}
else Message("No Admins Online");
}
}
Its tested and it works.
it looks horrible to me.
class Something{
Level = 0;
}
const MIN_ADMIN_LEVEL = 2;
g_stats <- array( GetMaxPlayers() );
function onPlayerJoin( CPlayer ){
g_stats[ CPlayer.ID ] = Something();
}
function onPlayerCommand( player, cmd, text ){
if( cmd == "admins" ){
local c_MaxPlayers = GetMaxPlayers(), c_AdminList = "";
for( local I = 0; I < c_MaxPlayers; I++ ) if( g_stats[ I ].Level >= ADMIN_MIN_LEVEL ) c_AdminList += FindPlayer( I ).Name + ", ";
Message( c_AdminList );
}
}
Don't have time to mess with other things. Untested code anyways.
oh no

[VM_U]Spectra.PhantoM^

if i show u a ss of it working wot will u do doom?
Wanna Talk To Me? Come At Irc #Jugo@LUNet

DizzasTeR

Quote from: {ultimatejugo] on Apr 04, 2016, 03:05 PMif i show u a ss of it working wot will u do doom?

Your SS should show the EXACT same code you posted in a blank server and show me its working.

MaTaDeToR

#9
Quote from: {ultimatejugo] on Apr 04, 2016, 03:05 PMif i show u a ss of it working wot will u do doom?
Why not try it in a Blank script then ? and where This sqliteDBeven exist? Just copy pasters dude! Add this stats <- array(GetMaxPlayers(), null);Change stats[ player.ID ] = PlayerClass( player.Name, sqliteDB ); to stats[ player.ID ] = PlayerClass(); and, so many!

KAKAN

Quote from: MaTaDeToR on Apr 04, 2016, 04:03 PM
Quote from: {ultimatejugo] on Apr 04, 2016, 03:05 PMif i show u a ss of it working wot will u do doom?
Why not try it in a Blank script then ? and where This sqliteDBeven exist? Just copy pasters dude!
What about the 'stats' array?
And what about this master-piece:-
else if (cmd == "admins" || cmd == "admin")
{
local plr = GetPlayers();
{
There are many errors in the code.
oh no

MaTaDeToR

Quote from: KAKAN on Apr 04, 2016, 04:05 PM
Quote from: MaTaDeToR on Apr 04, 2016, 04:03 PM
Quote from: {ultimatejugo] on Apr 04, 2016, 03:05 PMif i show u a ss of it working wot will u do doom?
Why not try it in a Blank script then ? and where This sqliteDBeven exist? Just copy pasters dude!
What about the 'stats' array?
And what about this master-piece:-
else if (cmd == "admins" || cmd == "admin")
{
local plr = GetPlayers();
{
There are many errors in the code.
I do mention it above my post, sorry it was edited, i guess you didn't recognize..... anyway i won't waste my time anymore....

NicusorN5

#12
You better try this :P
else if(cmd == "your command")
{
 {
  if (player == "admin1" || player == "admin2" || player == "admin3" )
  //Do things here
 {
{
Hope i helped you :D

Xmair


Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

NicusorN5