Problem about admin commands - 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: Problem about admin commands (
/showthread.php?tid=571990)
Problem about admin commands -
Steveproxy5 - 24.04.2015
Hi, I've found a problem about admin commands, when I type /rcon login [password] and then /admincommands shows nothing, is there anyone can help on skype? If you can send me a pm, I have a roleplay gamemode, and I need someone for helping my about editing of this one.
Код:
if(strcmp(cmd, "/comandiadmin", true) == 0 || strcmp(cmd, "/ca", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid,0x04C4D9AA,"[LIVELLO 1] - (/A)dmin - /Goto - /Fly - /Gethere - /Warn - /Muta - /Trova - /Aduty - /Kick - /Autokill - /Infoserver - /Maschere");
SendClientMessage(playerid,0x04C4D9AA,"[LIVELLO 1] - /blocca - /sblocca - /cnnn - /Gotolv - /Gotosf - /Gotols - /Fixveh - /Settaskin - /Settamondovirtuale - /Slap - /ricaricarapine");
SendClientMessage(playerid,0x04C4D9AA,"[LIVELLO 1] - /bloccorapinac - /bloccorapinab");
}
if (PlayerInfo[playerid][pAdmin] >= 2)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 2] /Banna - /Ascoltachat - /Ajail - /spec - /specoff - /SettaInterior - /RimuoviArmi");
}
if (PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 3] /Listafazioni");
}
if (PlayerInfo[playerid][pAdmin] >= 4)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 4] /Settavita - /Settaarmatura - /Riempiautobenzina - /Settadroga - /Settamateriali - /Settaprodotti - /Auto");
}
if (PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 5] /Donatore - /Settasoldi - /settaarma - /respawn - /Resettacell - /gotoauto - /gotocoord - /EntraAuto - /kickaclan - /kickff");
}
if (PlayerInfo[playerid][pAdmin] >= 6)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 6] ");
}
if (PlayerInfo[playerid][pAdmin] >= 7)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 7] /ComandiCasaAdmin - /ComandiBizAdmin - /ApriTutteAuto - /Sbanna - /Sbannaip");
}
if (PlayerInfo[playerid][pAdmin] >= 8)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 8] ");
}
if (PlayerInfo[playerid][pAdmin] >= 9)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 9] ");
}
if (PlayerInfo[playerid][pAdmin] >= 10)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 10] /SettaStats /kicktutti - /ComandiBuildingAdmin - /ComandiFazioneAdmin - /CreaAuto - /Concessionario - /Resetlotto");
}
if (PlayerInfo[playerid][pAdmin] >= 21)
{
SendClientMessage(playerid,0xFF0000AA,"[LIVELLO 21] - /apricapannina - /chiudicapannina /SettaAdmin - /SettaHelper - /SettaCapoFazione - /Resettafazione - /Settaspawncivili - /ComandiLavoriAdmin - /Settameteo - /Settaora - /CambiaNumero");
}
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_RED," Non sei loggato per utilizzare questo comando");
SendClientMessage(playerid,COLOR_RED," Effettua il login/registrazione");
return 1;
}
SendClientMessage(playerid,COLOR_WHITE," Comando invalido, digita /aiuto per la lista");
return 1;
}
Re: Problem about admin commands -
Konstantinos - 24.04.2015
Is
/admincommands supposed to be
/comandiadmin? If so, you do not check if the player is RCON admin (
IsPlayerAdmin function) but only if they have a level of your custom admin system.
Re: Problem about admin commands -
Steveproxy5 - 24.04.2015
Read the code
Re: Problem about admin commands -
Steveproxy5 - 24.04.2015
there is another command that's /settamiadmin [user] I can try to use this one to set a player as dmin
Re: Problem about admin commands -
Mrki_Drakula - 24.04.2015
You need to check is player logged in as a RCON admin.
The SAMP admin and your coded admin is not the same.
Код:
if(IsPlayerAdmin(playerid))
Re: Problem about admin commands -
Steveproxy5 - 24.04.2015
SOLVED