23.10.2012, 13:50
here
pawn Код:
#include <a_samp>
#define PINK 0xE100E1FF
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define INFINITY (Float:0x7F800000)
new Text3D:DutyTag[MAX_PLAYERS];
new bool:OnDuty[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(aduty,5,cmdtext);
return 1;
}
dcmd_aduty(playerid,params[])
{
#pragma unused params
//put admin variable here
if(OnDuty[playerid])
{
OnDuty[playerid] = false;
SetPlayerHealth(playerid,100.0);
Delete3DTextLabel(DutyTag[playerid]);
}
else
{
OnDuty[playerid] = true;
SetPlayerHealth(playerid,INFINITY);
SetPlayerColor(playerid,PINK);
DutyTag[playerid] = Create3DTextLabel("Dont Hit Admin on Duty",PINK,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(DutyTag[playerid], playerid, 0.0, 0.0, 1.5);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(OnDuty[playerid]) Delete3DTextLabel(DutyTag[playerid]);
OnDuty[playerid] = false;
return 1;
}