25.09.2013, 06:26
put this on the top of your script
replace this with your public
And the command
And OnPlayerConnect add these
Your welcome
pawn Код:
new draggedtimer[MAX_PLAYERS];
new dragged[MAX_PLAYERS];
new dragging[MAX_PLAYERS];
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);
}
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;
}
pawn Код:
dragged[playerid]=0;
dragging[playerid]=0; draggedtimer[playerid]=0;