alright let me try to make this
EDIT:
Here it is. Now lets pray alright? :P
At top:
pawn Код:
new DragTimer[MAX_PLAYERS];
forward Drag(giveplayerid, playerid);
onplayercommandthing
pawn Код:
if (strcmp(cmd, "/drag", true) == 0)
{
new giveplayerid = strval(tmp);
if(sapd[playerid] >=1)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /drag [playerid]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid,COLOR_RED, string);
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED, "You cannot drag yourself!");
return 1;
}
if(DragTimer[playerid] <= 0)
{
if(IsPlayerConnected(giveplayerid) == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid, x, y, z);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 3, X, Y, Z) && i != playerid && GetPlayerColor(i) == 0xFF8000FF)
{
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "Officer %s started dragging %s", playername, sendername);
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
DragTimer[playerid] = SetTimerEx("Drag", 1000, 1, "ii", playerid, giveplayerid);
TogglePlayerControllable(giveplayerid, 0);
return 1;
}
else SendClientMessage(playerid, COLOR_RED, " This player must be near you ");
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " You are not a Cop");
}
return 1;
}
you know here to put this ofc.
pawn Код:
public Drag(giveplayerid, playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid, x, y, z);
SetPlayerPos(playerid, x, y+0.5, z);
SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
return 1;
}
I did my best for you.
Please god, let it work