Drag CMD problem
#1

pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid;
    if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRank] >= 10))
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [playerid/partofname]");
    if(PlayerCuffed[giveplayerid] == 2) return SendClientMessage(playerid, COLOR_WHITE, "This player must first be cuffed");
    if(!ProxDetectorS(8.0, playerid, giveplayerid))
    {
        SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
        return 1;
    }
    if(Dragged[playerid] == 0 && Drag[playerid] == 0)
    Dragged[playerid] = 1;
    Drag[playerid] = 1;
    return 1;
}

CMD:stopdrag (playerid, params[])
{
    if(IsACop(playerid) || (PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRank] >= 10))
    Dragged[playerid] = 0;
    Drag[playerid] = 0;
    {
    return 1;
    }
}

//DRAG
forward Draggingt(playerid, ID);
public Draggingt(playerid, ID)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(playerid, dX, dY, dZ);
SetPlayerPos(ID, dX+1, dY, dZ);
}
Can't drag people, Someone said the problem is
pawn Код:
//DRAG
forward Draggingt(playerid, ID);
public Draggingt(playerid, ID)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(playerid, dX, dY, dZ);
SetPlayerPos(ID, dX+1, dY, dZ);
}
Reply
#2

What's exactly the problem?
Errors? Not doing anything? What?
Reply
#3

The CMD isn't work.
Reply
#4

put this on the top of your script
pawn Код:
new draggedtimer[MAX_PLAYERS];
new dragged[MAX_PLAYERS];
new dragging[MAX_PLAYERS];
replace this with your public
pawn Код:
forward Draggingt(playerid, iPlayer);
public Draggingt(playerid, iPlayer)
{
    new Float:dX, Float:dY, Float:dZ;
    GetPlayerPos(playerid, dX, dY, dZ);
    SetPlayerPos(iPlayer, dX+1, dY, dZ);
}
And the command
pawn Код:
CMD:drag(playerid, params[])
{
    new iPlayer, string[26+MAX_PLAYER_NAME], string2[20+MAX_PLAYER_NAME];
    if(sscanf(params, "u", iPlayer)) return SendClientMessage(playerid, COLOR_GREY, "CMD:/drug    [playerid]");
    if(dragged[iPlayer] == 0 && dragging[playerid == 0)
    {
        dragged[iPlayer]=1;
        dragging[playerid]=1;
        draggedtimer[iPlayer] = SetTimerEx("Draggingt", 1000, 1, "dd", playerid,iPlayer);
    }
    else
    {
     dragged[iPlayer]=0;
        dragging[playerid]=0;
        KillTimer(draggedtimer[iPlayer]);
    }
    return 1;
}
And OnPlayerConnect add these
pawn Код:
dragged[playerid]=0;
        dragging[playerid]=0; draggedtimer[playerid]=0;
Your welcome
Reply
#5

I don't want to use timer. I want a normal drag command, can you help me?
Reply
#6

Still not work!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)