30.08.2015, 00:33
(
Последний раз редактировалось JordanZaundd; 05.09.2016 в 06:45.
)
Please don't mix tabs and spaces together when formatting code, it makes it really unorganized. Please just use tabs for our sake. I've spent the past few minutes organizing this for you.
This should also fix your problem. Let me know if there are any errors.
This should also fix your problem. Let me know if there are any errors.
PHP код:
CMD:aduty(playerid, params[]) return SendClientMessage(playerid, red,"Changed to /adminduty");
CMD:aoffduty(playerid, params[]) return SendClientMessage(playerid, red,"Changed to /adminduty");
CMD:adminduty(playerid,params[])
{
if(PlayerInfo[playerid][Level] >= 1)
{
if(AntiSK[playerid] == 0)
{
new prevSkin, prevTeam, prevColor;
if(PlayerInfo[playerid][OnDuty] == 0)
{
PlayerInfo[playerid][OnDuty] = 1;
new str[128], AdminName[28];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(str, sizeof(str), "Administrator %s is now on Admin duty!", AdminName);
SendClientMessageToAll(0xF600F6FF, str);
prevSkin = GetPlayerSkin(playerid);
prevTeam = GetPlayerTeam(playerid);
prevColor = GetPlayerColor(playerid);
SetPlayerSkin(playerid,217);
SetPlayerTeam(playerid,6);
SetVehicleHealth(VID[playerid], 9999999999.0);
Duty[playerid] = Create3DTextLabel("On Duty Admin\n!!Do Not Attack!!", 0xF600F6FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(Duty[playerid], playerid, 0.0, 0.0, 0.5);
SetPlayerColor(playerid, 0xF600F6FF);
SetPlayerHealth(playerid, 100000000000);
SetPlayerArmour(playerid, 100000000000);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 31,500);
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
Update3DTextLabelText(DM[playerid], 0xFFFFFFFF, " ");
gTeam[playerid] = TEAM_MERC;
gClass[playerid] = CLASS;
}
else if(PlayerInfo[playerid][OnDuty] == 1)
{
PlayerInfo[playerid][OnDuty] = 0;
new str[128], AdminName[28];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(str, sizeof(str), "Administrator %s is now off Admin duty!", AdminName);
SendClientMessageToAll(0xFD01FDAA, str);
SetPlayerHealth(playerid, 0);
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
Update3DTextLabelText(Duty[playerid], 0xFFFFFFFF, " ");
SetPlayerSkin(playerid, prevSkin);
SetPlayerTeam(playerid, prevTeam);
SetPlayerColor(playerid, prevColor);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SpawnPlayer(playerid);
}
}
else{SendClientMessage(playerid,red,"You can't go when under Antisk");}
}
else{return 0;}
return 1;
}