drag command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: drag command (
/showthread.php?tid=276584)
drag command -
dud - 14.08.2011
i need command when police officer cuff you and then drag you whit him
Police officer pulls you...and stop drag you
Re: drag command -
Darnell - 14.08.2011
Well, that's a system, but I can do just /drag.
pawn Код:
if(strcmp(cmd, "/drag", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == yourPDfactionID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [Playerid/PartOfName]");
return 1;
}
else if (ProxDetectorS(3.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot drag yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(giveplayer);
GiveNameSpace(sendername);
format(string, sizeof(string), "* You are being dragged by %s, untill he stops.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You are dragging %s, untill you stop.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s starts dragging %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(giveplayerid, 0);
DragOff[giveplayerid] = playerid;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
return 1;
}
TRY this, not sure that this one works.
Re: drag command -
dud - 14.08.2011
i dont test but i dont think this will work
Re: drag command -
Darnell - 14.08.2011
Well, test it.
Re: drag command -
Derelict - 14.08.2011
Can you not simply make a command using whatever command processor you are using, that sets a variable saying the player is being dragged by whomever, and then set a recurring timer for a DragPlayer function or something that will update the player's position based on dragging?
It'd also need to make sure that the player is set as not controllable
Re: drag command -
dud - 21.08.2011
i make done