pawn Код:
CMD:drag(playerid, params[])
{
new gid;
if((IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken") && PlayerInfo[playerid][pJailed] == 0 || PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1)
{
if(sscanf(params,"u",gid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [PlayerID/PartOfName]");
if(!IsPlayerConnected(gid)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
if(playerid == gid) return SendClientMessage(playerid, COLOR_WHITE, "You cannot drag yourself. Sigh.");
if(PlayerCuffed[gid] == 2)
{
if(pDrag[gid] == -1 && pDragging[playerid] == -1)
{
TogglePlayerControllable(gid, 0);
pDrag[gid] = playerid;
pDragging[playerid] = gid;
new str[128];
format(str, 128,"* %s has started dragging %s from his cuffs.", GetPlayerNameEx(playerid), GetPlayerNameEx(gid));
ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
pDragTimer[playerid]=SetTimerEx("Drag", 1000, 1, "i", gid);
return 1;
}
else
{
if(pDrag[gid] != -1) return SendClientMessage(playerid, COLOR_WHITE, "That player is already being dragged.");
if(pDragging[playerid] != -1) return SendClientMessage(playerid, COLOR_WHITE, "You are already dragging someone else.");
}
}
else
{
return SendClientMessage(playerid, COLOR_WHITE, "That player is not cuffed.");
}
}
return SendClientMessage(playerid, COLOR_WHITE, "You are not a Law Enforcement Officer.");
}
CMD:stopdrag(playerid, params[])
{
if((IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken") && PlayerInfo[playerid][pJailed] == 0 || PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1)
{
if(pDragging[playerid] != -1)
{
new str[128];
format(str, 128,"* %s has let loose of %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(pDragging[playerid]));
ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(pDragging[playerid], 1);
KillTimer(pDragTimer[playerid]);
pDrag[pDragging[playerid]] = -1;
pDragging[playerid] = -1;
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "You are not dragging anyone.");
}
return SendClientMessage(playerid, COLOR_WHITE, "You are not a Law Enforcement Officer.");
}