Admin Override - 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)
+--- Thread: Admin Override (
/showthread.php?tid=578856)
Admin Override -
TheMafien - 22.06.2015
Hey,
I just started up my server with a script my friend sent me and I want to add an Admin override system into the script, has anyone got the code I need or help? Thanks +REP If helped.
Re: Admin Override -
rappy93 - 22.06.2015
I'm afraid this section is not for requesting scripts. Just try to make it yourself and if you don't know how to do something you can post here and get help.
Re: Admin Override -
TheMafien - 22.06.2015
Quote:
Originally Posted by rappy93
I'm afraid this section is not for requesting scripts. Just try to make it yourself and if you don't know how to do something you can post here and get help.
|
That's exactly what I just did
Re: Admin Override -
rappy93 - 22.06.2015
Then what do you need help with ? Where did you get stuck ? What exactly is not working with your script ?
Re: Admin Override -
Prokill911 - 22.06.2015
It's not like you need a system..
Example:
PHP код:
#define ADMINOVERRIDE_PASS changeme123
#define MAX_ADMIN_OVERRIDE_ATTEMPTS 3
YCMD:adminoverride(playerid, params[], help) {
new msg[128];
new pass[64];
if(!sscanf(params,"s[64]", pass)) {
if(!strcmp(pass, ADMINOVERRIDE_PASS)) {
SetPVarInt(playerid, "YOUR ADMIN PVAR", [WHAT EVER YOU ADMIN LEVEL MAXES]);
EnumName[playerid][AdminLevel][Level]
SendClientMessage(playerid, X11_BLUE3, "Accepted!");
} else {
new numoverrides = GetPVarInt(playerid, "FailedAdminOverrides");
if(numoverrides >= MAX_ADMIN_OVERRIDE_ATTEMPTS) {
KickEx(playerid, "To many admin override attempts");
return 0;
}
SetPVarInt(playerid, "FailedAdminOverrides", ++numoverrides);
return 0;
}
}
return 1;
}
Re: Admin Override -
TheMafien - 22.06.2015
Quote:
Originally Posted by Prokill911
It's not like you need a system..
Example:
PHP код:
#define ADMINOVERRIDE_PASS changeme123
#define MAX_ADMIN_OVERRIDE_ATTEMPTS 3
YCMD:adminoverride(playerid, params[], help) {
new msg[128];
new pass[64];
if(!sscanf(params,"s[64]", pass)) {
if(!strcmp(pass, ADMINOVERRIDE_PASS)) {
SetPVarInt(playerid, "YOUR ADMIN PVAR", [WHAT EVER YOU ADMIN LEVEL MAXES]);
EnumName[playerid][AdminLevel][Level]
SendClientMessage(playerid, X11_BLUE3, "Accepted!");
} else {
new numoverrides = GetPVarInt(playerid, "FailedAdminOverrides");
if(numoverrides >= MAX_ADMIN_OVERRIDE_ATTEMPTS) {
KickEx(playerid, "To many admin override attempts");
return 0;
}
SetPVarInt(playerid, "FailedAdminOverrides", ++numoverrides);
return 0;
}
}
return 1;
}
|
Thank you +REP