Cuff command
#3

pawn Код:
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
    new Float:x1,Float:y1,Float:z1,Float:x3,Float:y3,Float:z3;
    if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
    {
        return -1.00;
    }
    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x3,y3,z3);
    return floatsqroot(floatpower(floatabs(floatsub(x3,x1)),2)+floatpower(floatabs(floatsub(y3,y1)),2)+floatpower(floatabs(floatsub(z3,z1)),2));
}

CMD:cuff(playerid, params[])
{
    new string[128], targetid;
    if(IsCop[playerid] == false) return SendClientMessage(playerid, COLOR_WHITE, "Error: Only Cops can use this command");
    if(sscanf(params, "u", targetid))return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cuff [playerid/name]");
    if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_WHITE, "Error: This player is not Connected!");
    if(targetid == playerid) return SendClientMessage(playerid,COLOR_WHITE,"Error: You cannot cuff yourself!");
    if(GetDistanceBetweenPlayers(playerid,targetid) > 3) return SendClientMessage(playerid, COLOR_WHITE, "Error: You are not close enough to this player!");
    if(Cuffed[targetid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Error: This Player Is Already Handcuffed.");
    SetPlayerSpecialAction(targetid, SPECIAL_ACTION_CUFFED);
    ApplyAnimation(targetid,"ped","WEAPON_crouch",4.1,1,0,0,0,0,1);
    Cuffed[targetid] = 1;
    return 1;
}
Reply


Messages In This Thread
Cuff command - by AustinWeerdGuy - 12.03.2014, 17:22
Re: Cuff command - by AustinWeerdGuy - 12.03.2014, 21:13
Re: Cuff command - by AnonScripter - 12.03.2014, 21:23
Re: Cuff command - by CallumDaBest - 12.03.2014, 21:23
Re: Cuff command - by AustinWeerdGuy - 12.03.2014, 21:43
Re: Cuff command - by Necip - 12.03.2014, 21:55
Re: Cuff command - by AustinWeerdGuy - 12.03.2014, 22:18
Re: Cuff command - by AustinWeerdGuy - 13.03.2014, 14:26
Re: Cuff command - by Chrillzen - 13.03.2014, 14:31
Re: Cuff command - by Drago987 - 13.03.2014, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)