Admins Hid Until They Type /aduty -
[LHT]Bally - 12.01.2013
How do i make it so that all my admins are hid untl they type /aduty, and /oduty to be hidden again.
So when admin joins server it doesnt recognise them as admin until they use /aduty.
/admin command is like :
pawn Код:
COMMAND:admins(playerid, params[])
{
// Setup local variables
new AdminList[500], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/admins", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
// Check if this player is an RCON admin
if (IsPlayerAdmin(i))
{
// Add all admin players to the list
format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i (RCON admin)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
// Re-start the for loop (skipping the remaining code for this iteration)
continue;
}
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][PlayerLevel] > 0)
{
// Add all admin players to the list
format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
}
}
}
// Check if there were admin-names added to the list
if (strlen(AdminList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "European Trucking Admins:", AdminList, "OK", "Cancel");
else
SendClientMessage(playerid, 0xFF0000FF, "No admin online"); // No admins are online
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Thanks all in advance
Re: Admins Hid Until They Type /aduty -
Infinity90 - 12.01.2013
pawn Код:
new VisableDuty[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
VisableDuty[playerid] = 0;
return 1;
}
//On your /aduty command add
VisableDuty[playerid] = 1;
//On your /oduty command add
VisableDuty[playerid] = 0;
//Now back to /admins
COMMAND:admins(playerid, params[])
{
// Setup local variables
new AdminList[500], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/admins", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Scan through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if this player is connected
if (IsPlayerConnected(i))
{
// Get the name of the player
GetPlayerName(i, Name, sizeof(Name));
// Check if this player is an RCON admin
if (IsPlayerAdmin(i))
{
// Add all admin players to the list
format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i (RCON admin)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
// Re-start the for loop (skipping the remaining code for this iteration)
continue;
}
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][PlayerLevel] > 0)
{
if(VisableDuty[i] == 1)
{
// Add all admin players to the list
format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
}
}
}
}
// Check if there were admin-names added to the list
if (strlen(AdminList) > 0)
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "European Trucking Admins:", AdminList, "OK", "Cancel");
else
SendClientMessage(playerid, 0xFF0000FF, "No admin online"); // No admins are online
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Should work
Re: Admins Hid Until They Type /aduty -
[LHT]Bally - 13.01.2013
i get these errors
pawn Код:
error 017: undefined symbol "MAX_PLAYERS"
: error 009: invalid array size (negative, zero or out of bounds)
Re: Admins Hid Until They Type /aduty -
Threshold - 13.01.2013
Do you have a_samp included? 0_o
at the top of your script.
Re: Admins Hid Until They Type /aduty -
[LHT]Bally - 13.01.2013
yes its in the gamemode alreaddy
Re: Admins Hid Until They Type /aduty -
Infinity90 - 13.01.2013
Make sure you placed
pawn Код:
new VisableDuty[MAX_PLAYERS];
Below all your includes.
Re: Admins Hid Until They Type /aduty -
[LHT]Bally - 13.01.2013
now it says this is not defined :S
pawn Код:
//Check if that player is an admin (using the PlayerLevel)
if (APlayerData[i][PlayerLevel] > 0)
{
if(VisableDuty[i] == 1)
{
Re: Admins Hid Until They Type /aduty -
[LHT]Bally - 13.01.2013
anyone
Re: Admins Hid Until They Type /aduty -
Infinity90 - 13.01.2013
Show me where you have placed
pawn Код:
new VisableDuty[MAX_PLAYERS];
Show me all the lines above were you posted it
Re: Admins Hid Until They Type /aduty -
[LHT]Bally - 13.01.2013
it is put below this
pawn Код:
// Include default files
#include <a_samp>
#include <zcmd>
#include <dutils>
#include <sscanf2>
#include <streamer>
#include <dini>