drag command
#1

i need command when police officer cuff you and then drag you whit him
Police officer pulls you...and stop drag you
Reply
#2

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.
Reply
#3

i dont test but i dont think this will work
Reply
#4

Well, test it.
Reply
#5

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
Reply
#6

i make done
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)