Im in middle of working on an RP mode and Im pretty new scripter and I dont really know how to script a drag command.
The command should be made like the cuff command with cops permission or something like that, Cuff CMD :
CMD:cuff(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsAFBI(playerid) && !IsAHSF(playerid) && !IsASWAT(playerid) && !IsASATF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD Oficer/FBI/HSF.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
if(!IsPlayerTazed(playerb) && GetPlayerSpecialAction(playerb) != SPECIAL_ACTION_HANDSUP) return SendClientMessage(playerid, COLOR_GREY, "Player is not tazed nor has their hands up.");
// /me Message & Animation
GameTextForPlayer(playerb, "~r~Cuffed", 3500, 3);
format(string, sizeof(string), "* %s pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerid), RPN(playerb));
if(PlayerInfo[playerid][pMaskOn] == 1)
{
format(string, sizeof(string), "* Stranger pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerb));
}
else
{
format(string, sizeof(string), "* %s pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerid), RPN(playerb));
}
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
ClearAnimations(playerb);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1 );
// Custom Freeze
TogglePlayerControllable(playerb, 0);
//ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1 );
SetPlayerAttachedObject(playerb, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(playerb,SPECIAL_ACTION_CUFF ED);
// Tazed Setting
TogglePlayerTazed(playerb, 0);
TogglePlayerCuffed(playerb, 1);
// Cuff Timeout
CuffTimeout[playerb] = 9000;
KillTimer(TazeCountDown[playerb]);
CuffCountDown[playerb] = SetTimerEx("CuffTimer", 1000, true, "d", playerb);
return 1;
}
I'd like to make drag command but I dont know how...
Thanks for helping !