SA-MP Forums Archive
*** Terrible Title Removed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: *** Terrible Title Removed (/showthread.php?tid=387127)



*** Terrible Title Removed - [NMD]Chronos - 23.10.2012

any one can give me

dcmd_aduty

With text at his head color pink, Dont Hit Admin on Duty


Re: i hope anyone can help Me - McCarthy - 23.10.2012

https://sampforum.blast.hk/showthread.php?tid=187229


Re: i hope anyone can help Me - mincer - 23.10.2012

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;
}



Re: i hope anyone can help Me - [NMD]Chronos - 24.10.2012

how to add admin level on that command ? only lvl 2 can use it