CMD:aod(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid])
{
format(string, sizeof(string), "AdmWarn: %s has went on admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
aDuty[playerid] = 1;
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
format(string, sizeof(string), "{FF6347}ARP Administartor\n{FFFFFF}%s\n{2641FE}%s", RPN(playerid), RPALN(playerid));
if(IsValidDynamic3DTextLabel(aDutyText[playerid])) DestroyDynamic3DTextLabel(aDutyText[playerid]);
if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1337) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1338) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
GiveDodWeapon(playerid, 38, 11999);
SetPlayerArmour(playerid, 1000000000.0);
SetPlayerHealth(playerid, 1000000000.0);
//SetPlayerSkin(playerid, 294);
}
else
{
if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
aDuty[playerid] = 0;
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
DestroyDynamic3DTextLabel(aDutyText[playerid]);
//new oldskinsss;
//oldskinsss = PlayerInfo[playerid][pModel];
//SetPlayerSkin(playerid, oldskinsss);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
ResetPlayerWeapons(playerid);
ResetDodWeapons(playerid);
}
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++) { ShowPlayerNameTagForPlayer(i, playerid, true); }
|
This should work.
PHP код:
|
CMD:aod(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid])
{
format(string, sizeof(string), "AdmWarn: %s has went on admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
aDuty[playerid] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
}
format(string, sizeof(string), "{FF6347}ARP Administartor\n{FFFFFF}%s\n{2641FE}%s", RPN(playerid), RPALN(playerid));
if(IsValidDynamic3DTextLabel(aDutyText[playerid])) DestroyDynamic3DTextLabel(aDutyText[playerid]);
if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1337) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1338) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
GiveDodWeapon(playerid, 38, 11999);
SetPlayerArmour(playerid, 1000000000.0);
SetPlayerHealth(playerid, 1000000000.0);
//SetPlayerSkin(playerid, 294);
}
else
{
if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
aDuty[playerid] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, true);
}
format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
DestroyDynamic3DTextLabel(aDutyText[playerid]);
//new oldskinsss;
//oldskinsss = PlayerInfo[playerid][pModel];
//SetPlayerSkin(playerid, oldskinsss);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
ResetPlayerWeapons(playerid);
ResetDodWeapons(playerid);
}
return 1;
}