What is wrong with that ? -
RotAway - 27.11.2015
Код:
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);
}
When i use /drag it says "That command does not exist. Use /help to see the commands."
What's the problem ?
( No pawno errors warnings etc. )
Re: What is wrong with that? -
MasterReturnz - 27.11.2015
Try put the forward and public first like this:
Код:
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);
}
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;
}