27.11.2015, 21:02
Код:
CMD:drag(playerid, params[]) { new ID, string[26+MAX_PLAYER_NAME], string2[20+MAX_PLAYER_NAME]; if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE:/drag [playerid/PartOfName] , type /drag again to stop dragging"); if(PlayerCuffed[ID] == 0) return SendClientMessage(playerid, COLOR_GREY, "This player must first be cuffed"); if(PlayerDragged[ID] == 0 && PlayerDraggedBy[playerid] == 0) { PlayerDragged[ID] = 1; PlayerDraggedBy[playerid] = 1; format(string, sizeof(string), "* %s grabs %s, and has started dragging them.", GetPlayerNameEx(playerid), GetPlayerNameEx(ID)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(ID, "~r~being dragged", 2500, 3); format(string, sizeof(string), "You are being dragged by %s.", GetPlayerNameEx(playerid)); format(string2, sizeof(string2), " You are dragging %s ,type /drag again to stop dragging", GetPlayerNameEx(ID)); SCM(playerid, COLOR_WHITE, string2); SCM(ID, COLOR_WHITE, string); draggedtimer[ID] = SetTimerEx("Draggingt", 1000, 1, "dd", playerid,ID); } else { PlayerDragged[ID] = 0; PlayerDraggedBy[playerid] = 0; format(string, sizeof(string), "* %s grabs %s, and has stopped dragging them.", GetPlayerNameEx(playerid), GetPlayerNameEx(ID)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(ID, "~r~Restained", 2500, 3); SCM(playerid, COLOR_WHITE, "You have stopped dragging your target."); SCM(ID, COLOR_WHITE, "You aren't being dragged anymore."); KillTimer(draggedtimer[ID]); } return 1; } 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); }
What's the problem ?
( No pawno errors warnings etc. )