29.10.2015, 08:38
PHP код:
new Text3D:labela[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(labela[playerid]);
}
return 1;
CMD:aod(playerid)
{
if(pInfo[playerid][pLogged] == 1)
{
if(pInfo[playerid][pAdminLevel] >= 1)
{
if(pInfo[playerid][pAdminDuty] == 0)
{
pInfo[playerid][pAdminDuty] = 1;
new adutyonstring[128];
format(adutyonstring, sizeof(adutyonstring), "{DC143C}Administrator %s is now On Duty!" ,PlayerName(playerid));
SendClientMessageToAll(-1,adutyonstring);
SetPlayerColor(playerid,0xFFFFFF00);
SetPlayerSkin(playerid, 217);
SetPlayerHealth(playerid,999999.0);
//labela[playerid] = Create3DTextLabel("Admin On Duty", 0x00FF00FF, 30.0, 40.0, 50.0, 40.0, 0);
//Attach3DTextLabelToPlayer(labela[playerid], playerid, 0.0, 0.0, 0.7);
SendClientMessage(playerid,COLOR_RED,""chat" Remember to /aod when you play as a regular player.");
}
else
{
if(pInfo[playerid][pAdminDuty] == 1)
{
pInfo[playerid][pAdminDuty] = 0;
new adutyoffstring[128];
Delete3DTextLabel(labela[playerid]);
ResetPlayerWeaponsEx(playerid, 23,25);
format(adutyoffstring, sizeof(adutyoffstring), "{DC143C}Administrator %s is now Off Duty." ,PlayerName(playerid));
SendClientMessageToAll(-1,adutyoffstring);
if(team[playerid] == TEAM_ZOMBIE)
{
SetPlayerColor(playerid,COLOR_ZOMBIE);
}
if(team[playerid] == TEAM_HUMAN)
{
SetPlayerColor(playerid,COLOR_HUMAN);
}
SetPlayerHealth(playerid,100);
}
}
}
}
else if(pInfo[playerid][pLogged] == 0)
{
//SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try , KICKED!");
printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
Kick(playerid);
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(pInfo[playerid][pAdminDuty] == 1)
{
pInfo[playerid][pAdminDuty] = 0;
}