Drag CMD problem
#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


Messages In This Thread
Drag CMD problem - by Jizz - 25.09.2013, 05:29
Re: Drag CMD problem - by JamesH - 25.09.2013, 05:45
Re: Drag CMD problem - by Jizz - 25.09.2013, 06:01
Re: Drag CMD problem - by JamesH - 25.09.2013, 06:26
Re: Drag CMD problem - by Jizz - 25.09.2013, 13:44
Re: Drag CMD problem - by Jizz - 25.09.2013, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)