Cuff doesnt work properly
#1

Everything works except the cuff does not appear as it is supposed to:
Код:
COMMAND:cuff(playerid,params[])
{
	new obj,pname[MAX_PLAYER_NAME],rname[MAX_PLAYER_NAME],string[128],string1[128],string2[128],id,Float:x,Float:y,Float:z;
	if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFFFFFFFF,"Correct Usage: /cuff id");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFFFFFFFF,"Player not connected!");
	if(cuffed[id] == 1) return SendClientMessage(playerid,0xFFFFFFFF,"This player is already cuffed!");
	if(copduty[playerid] == 0) return SendClientMessage(playerid,0xFFFFFFF,"Only on duty police may use this command!");
	GetPlayerPos(playerid,x,y,z);
	GetPlayerName(playerid,pname,sizeof(pname));
	GetPlayerName(id,rname,sizeof(rname));
	if(IsPlayerInRangeOfPoint(id,5,x,y,z))
	{
	obj = CreateObject(19418,0,0,0,0,0,0,0);
	SetPlayerAttachedObject(id,5,obj, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
	SetPlayerSpecialAction(id,24);
	format(string,sizeof(string),"You have cuffed %s(%i).",rname,id);
	format(string1,sizeof(string),"You have been cuffed by %s(%i).",pname,playerid);
	format(string2,sizeof(string2),"%s(%i) takes their handcuffs, cuffing %s(%i).",pname,playerid,rname,id);
	SendClientMessage(playerid,0xFFFFFFFF,string);
	SendClientMessage(id,0xFFFFFFFF,string1);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	if(IsPlayerInRangeOfPoint(i,5,x,y,z))
	{
	SendClientMessage(i,0xc2a2daFF,string2);
	}
	}
	cuffed[id] = 1;
	}
	else
	{
	SendClientMessage(playerid,0xFFFFFFFF,"You are not close enough to cuff this person!");
	}
	return 1;
}
Reply


Messages In This Thread
Cuff doesnt work properly - by jtemple042996 - 02.08.2012, 14:14
Re: Cuff doesnt work properly - by Ranama - 02.08.2012, 14:33

Forum Jump:


Users browsing this thread: 1 Guest(s)