09.09.2017, 15:14
I'm still very new to the scripting thing so I need some help.
I'm working on a drag command where if but I'm at a loss, could I get a hand? Thanks in advance.
I'm working on a drag command where if but I'm at a loss, could I get a hand? Thanks in advance.
PHP код:
CMD:drag(playerid,params[])
{
new id, Float:X, Float:Y, Float:Z;
if(!PlayerInfo[playerid][pFaction] < 1) return SCM(playerid, COLOR_GREY,"You're not authorized to use this command.");
else if(isDragged[id] == true) return SCM(playerid, COLOR_LIGHTRED, "That player is already being dragged.");
else if(sscanf(params,"ui", playerid)) return SCM(playerid, COLOR_GREY,"[Usage:] /drag, id.");
if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_LIGHTRED,"That player is not connected.");
if(id == playerid) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't drag yourself.");
if(!IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) return SCM(playerid, COLOR_GREY,"That player is not near you.");
isDragged[id] = true;
isDragging[playerid] = true;
return 1;
}