if(!strcmp(cmdtext, "/adminduty", true)) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes on duty as admin", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes off duty as admin", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You're not the admin !");
return 1;
}
}
return 1;
}
if(AdminDuty[i] == 0)
{
// show the admins
}
|
Originally Posted by Ettans
Add a check tho the /admins command.
pawn Код:
|
|
Originally Posted by Ettans
Nothing. You just add that check before showing the online admins.
|
if(!strcmp(cmdtext, "/adminduty", true))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes on duty as admin", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes off duty as admin", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You're not the admin !");
return 1;
}
}
return 1;
}
if(AdminDuty[i] == 1)
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341) replace it for if(AdminDuty[playerid] == 1)
|
Originally Posted by Reality King
what you have to do its edit the code /admins and where it says this line
Код:
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341) replace it for if(AdminDuty[playerid] == 1) ![]() |
