14.04.2012, 12:19
need help command /aduty not work pls help iam need it now pls pls pls
new Text3D:Aduty[MAX_PLAYERS]; new Duty[MAX_PLAYERS]= 0;
if(strcmp(cmdtext, "/aduty", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >=1) //However you define whether a player is an administrator
{
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Duty[playerid] == 0)
{
Duty[playerid]= 1;
SetPlayerHealth(playerid,99999);
Aduty[playerid] = Create3DTextLabel("ADMIN ON DUTY! DO NOT ATTACK",GetPlayerColor(playerid),0.0,0.0,0.0,NAMETAG_DRAW_DISTANCE,-1,0);
Attach3DTextLabelToPlayer(Aduty[playerid],playerid,0.0,0.0,0.75);
format(string, sizeof(string), "* Admin %d %s is now on Admin Duty!.", PlayerInfo[playerid][pAdmin],sendername);
SendClientMessageToAll(0xAA3333AA, string);
}
else
{
SetPlayerHealth(playerid,100);
Duty[playerid]= 0;
Delete3DTextLabel(Aduty[playerid]);
format(string, sizeof(string), "* %d %s is now off Admin Duty!.", PlayerInfo[playerid][pAdmin],sendername);
SendClientMessageToAll(0xAA3333AA, string);
}
}
else
{
SendClientMessage(playerid,0x1229FAFF, "you're not an admin!");
}
return 1;
}
|
Top of your script
Код:
new Text3D:Aduty[MAX_PLAYERS]; new Duty[MAX_PLAYERS]= 0; Код:
if(strcmp(cmdtext, "/aduty", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >=1) //However you define whether a player is an administrator
{
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Duty[playerid] == 0)
{
Duty[playerid]= 1;
SetPlayerHealth(playerid,99999);
Aduty[playerid] = Create3DTextLabel("ADMIN ON DUTY! DO NOT ATTACK",GetPlayerColor(playerid),0.0,0.0,0.0,NAMETAG_DRAW_DISTANCE,-1,0);
Attach3DTextLabelToPlayer(Aduty[playerid],playerid,0.0,0.0,0.75);
format(string, sizeof(string), "* Admin %d %s is now on Admin Duty!.", PlayerInfo[playerid][pAdmin],sendername);
SendClientMessageToAll(0xAA3333AA, string);
}
else
{
SetPlayerHealth(playerid,100);
Duty[playerid]= 0;
Delete3DTextLabel(Aduty[playerid]);
format(string, sizeof(string), "* %d %s is now off Admin Duty!.", PlayerInfo[playerid][pAdmin],sendername);
SendClientMessageToAll(0xAA3333AA, string);
}
}
else
{
SendClientMessage(playerid,0x1229FAFF, "you're not an admin!");
}
return 1;
}
|