Break Cuffs and alog +3REP
#1

I need these cmds ive tried making but failed (dcmd only) alog dcmd aswell
+3REP
Reply
#2

What does the command need to do?

Something I brewed up:

Top of your script (under includes and defines):

pawn Код:
new pCuffed[MAX_PLAYERS];
You need a command which sets the player variable (pCuffed) to one. I can also give you that command if you don't have it. To break it down:

pawn Код:
CMD:cuff(playerid, params[])
{
    new tid, string[64], name[MAX_PLAYER_NAME];

    if(sscanf(params, "u", tid)) return SendClientMessage(playerid, -1, "/cuff [ID]");
    if(!IsPlayerConnected(tid)) return SendClientMessage(playerid, -1, "The ID you entered isn't connected to the server.");

    if(pCuffed[tid] == 0)
    {
        pCuffed[tid] = 1; // set var

        format(string, sizeof(string), "You have cuffed %s.", GetPlayerName(tid, name, sizeof(name)) );
        SendClientMessage(playerid, -1, string);

        SetPlayerSpecialAction(tid, SPECIAL_ACTION_CUFFED);
        SetPlayerAttachedObject(tid, 7, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
    }
    else SendClientMessage(playerid, -1, "Player is already cuffed!");
    return 1;
}
pawn Код:
CMD:breakcuffs(playerid, params[])
{
    new tid, string[64], name[MAX_PLAYER_NAME];

    if(sscanf(params, "u", tid)) return SendClientMessage(playerid, -1, "/uncuff [ID]");
    if(!IsPlayerConnected(tid)) return SendClientMessage(playerid, -1, "The ID you entered isn't connected to the server.");

    if(pCuffed[tid] == 1)
    {
        pCuffed[tid] = 0; // set var

        format(string, sizeof(string), "You have broken %s's cuffs.", GetPlayerName(tid, name, sizeof(name)) );
        SendClientMessage(playerid, -1, string);

        RemovePlayerAttachedObject(playerid, 7); // remove their attached object
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    }
    else SendClientMessage(playerid, -1, "Player isn't cuffed!");
    return 1;
}
For individual use only:
pawn Код:
CMD:breakcuffs(playerid, params[])
{
    new string[64];

    if(pCuffed[tid] == 1)
    {
        pCuffed[tid] = 0; // set var

        SendClientMessage(playerid, -1, "You have broken your cuffs.");

        RemovePlayerAttachedObject(playerid, 7); // remove their attached object
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    }
    else SendClientMessage(playerid, -1, "You aren't cuffed!");
    return 1;
}
For logs: https://sampforum.blast.hk/showthread.php?tid=160593
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)