Huge problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Huge problem (
/showthread.php?tid=97153)
Huge problem -
_Vortex - 13.09.2009
Hello, I have a big problem
If someone goes on a persons account who has an admin level, and doesn't login, they can use admin commands. I'm using dini, what can I put on OnPlayerConnect to disable this from happening?
Re: Huge problem -
[HiC]TheKiller - 13.09.2009
Do something like:
pawn Код:
if(Loggedin[playerid] == 0)
{
SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!");
Adminlevel[playerid] = 0;
}
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
Re: Huge problem -
_Vortex - 13.09.2009
Quote:
Originally Posted by [HiC
TheKiller ]
Do something like:
pawn Код:
if(Loggedin[playerid] == 0) { SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!"); Adminlevel[playerid] = 0; }
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
|
Where would I put this?
Re: Huge problem -
RaFsTar - 13.09.2009
If you are using a dini saving system, you must have a loader, and a saver.
You put the loader when player logs in, it will give all stuff to him.
And the saver when player disconnects.
Show us your dini saving system, if you need help i can give you mine
Re: Huge problem -
[HiC]TheKiller - 13.09.2009
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Do something like:
pawn Код:
if(Loggedin[playerid] == 0) { SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!"); Adminlevel[playerid] = 0; }
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
|
Where would I put this?
|
You could really put that anywhere. A better way would probably be to give the admin level after they login, not when they connect.
Re: Huge problem -
_Vortex - 13.09.2009
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Do something like:
pawn Код:
if(Loggedin[playerid] == 0) { SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!"); Adminlevel[playerid] = 0; }
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
|
Where would I put this?
|
You could really put that anywhere. A better way would probably be to give the admin level after they login, not when they connect.
|
I've tried to put pInfo[playerid][Level] = 0 on onplayerconnect, but that just sets their level to 0, making it so if the real admin connects and logs in, they're level is gone.
Re: Huge problem -
[HiC]TheKiller - 13.09.2009
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Do something like:
pawn Код:
if(Loggedin[playerid] == 0) { SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!"); Adminlevel[playerid] = 0; }
I've tried to put pInfo[playerid][Level] = 0 on onplayerconnect, but that just sets their level to 0, making it so if the real admin connects and logs in, they're level is gone.
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
|
Where would I put this?
|
You could really put that anywhere. A better way would probably be to give the admin level after they login, not when they connect.
|
|
What about it? If you want to know where to post the code, the best place would be OnPlayerSpawn and disable admin commands before spawn.
Re: Huge problem -
_Vortex - 13.09.2009
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by [HiC
TheKiller ]
Do something like:
pawn Код:
if(Loggedin[playerid] == 0) { SendCleintMessage(playerid, COLOUR, "LOG THE **** IN!"); Adminlevel[playerid] = 0; }
I've tried to put pInfo[playerid][Level] = 0 on onplayerconnect, but that just sets their level to 0, making it so if the real admin connects and logs in, they're level is gone.
Change Loggedin to your variable which checks if they are logged in, and change Adminlevel to the admin variable.
|
Where would I put this?
|
You could really put that anywhere. A better way would probably be to give the admin level after they login, not when they connect.
|
|
What about it? If you want to know where to post the code, the best place would be OnPlayerSpawn and disable admin commands before spawn.
|
Oh sorry, I posted my reply witin your quote.
I've tried to put pInfo[playerid][Level] = 0 on onplayerconnect, but that just sets their level to 0, making it so if the real admin connects and logs in, they're level is gone.
Re: Huge problem -
[HiC]TheKiller - 13.09.2009
Give them there level when they login. When they use the /login command and it is successful then pInfo[playerid][Level] = 5 or whatever their admin level is.
Re: Huge problem -
_Vortex - 13.09.2009
Quote:
Originally Posted by [HiC
TheKiller ]
Give them there level when they login. When they use the /login command and it is successful then pInfo[playerid][Level] = 5 or whatever their admin level is.
|
Yes but the level still needs to be saved somewhere.. So I cant just set their level to whatever, it needs to be the level i assign to them.