/cuff to zcmd
#1

Anyone here can convert this is zcmd? and if possible only admins can use this command.


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/cuffed", cmdtext, true, 7) == 0)
        {
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
        SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
                return 1;
        }
        if (strcmp("/uncuff", cmdtext, true, 7) == 0)
        {
        for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
        {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
        }
        return 1;
    }
        return 0;
}
Reply
#2

pawn Код:
CMD:cuffed(playerid, params[])
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
    SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
    return 1;
}

CMD:uncuff(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    }
    return 1;
}
Need a admin variable to script that in.
Reply
#3

Quote:
Originally Posted by ryansheilds
Посмотреть сообщение
pawn Код:
CMD:cuffed(playerid, params[])
{
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
    SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
    return 1;
}

CMD:uncuff(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    }
    return 1;
}
Need a admin variable to script that in.
Thanks for the reply iam using luxadmin and its not using CMD (sorry i have just notice) can you changed it to dmcd.

This is the format

pawn Код:
dcmd_slap(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 2)
        {
            new Index;
            new tmp[256];  tmp  = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);

            if(!strlen(params)) return
            SendClientMessage(playerid, yellow, "Usage: /slap [PlayerID/PartOfName] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Slap the specified player");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
             {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                SendCommandToAdmins(playerid,"Slap");
                new Float:Health;
                new Float:x, Float:y, Float:z;
                GetPlayerHealth(player1,Health);
                SetPlayerHealth(player1,Health-25);
                GetPlayerPos(player1,x,y,z);
                SetPlayerPos(player1,x,y,z+5);
                PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
                PlayerPlaySound(player1,1190,0.0,0.0,0.0);

                if(strlen(tmp2))
                {
                format(string,sizeof(string),"You have slapped %s | Reason: %s ",playername,params[2]);
                return SendClientMessage(playerid,BlueMsg,string);
                }
                else
                {
                format(string,sizeof(string),"You have slapped %s ",playername);
                return SendClientMessage(playerid,BlueMsg,string);
                }
            }
            else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Thanks ill wait for the reply! +rep
Reply
#4

pawn Код:
CMD:cuffed(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
                SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
            }
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}

CMD:uncuff(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
            }
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}
Reply
#5

Quote:
Originally Posted by Cxnnor
Посмотреть сообщение
pawn Код:
CMD:cuffed(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
                SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
            }
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}

CMD:uncuff(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
            }
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}
OMG! Thanks for the reply. But for the last can you convert it to dcmd? +rep
Reply
#6

pawn Код:
dcmd_cuffed(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
                SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
            }
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}

dcmd_uncuff(playerid, params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
        {
            if(AccInfo[playerid][Level] >= 2)
            {
                for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
            }
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
        }
    else SendClientMessage(playerid, COLOR_RED, "You cannot perform this command!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)