proxdetector return message
#1

I added a proxdetector to my /cuff command...but how do i make it display.."you are not near this player" if the player is online, and is not near the player who is trying to /cuff

Heres the /cuff command:

Код:
if (strcmp("/cuff", cmd, true) == 0)
 	{
 	  if(gTeam[playerid] == TEAM_COP)
		{
		new giveplayerid;
		new giveplayer[MAX_PLAYER_NAME];
		new sendername[MAX_PLAYER_NAME];
		tmp = strtok(cmdtext, idx);
		if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; }
		if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_GREY, "Cannot use this while being in the Car!");
		if(!strlen(tmp)) SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /cuff [playerid]");
 		if(IsPlayerConnected(strval(tmp)) == 0)return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: That ID not an active player ");

		giveplayerid = ReturnUser(tmp);
		if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,COLOR_LIME,"You cannot cuff Law enforcement agents !");
		TogglePlayerControllable(giveplayerid,0);
		GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
		GetPlayerName(playerid,sendername,sizeof(sendername));
		format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer);
		ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
		SendClientMessage(playerid,0x33AA33AA,tmp);
		format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername);
		SendClientMessage(giveplayerid,0xAA3333AA,tmp);
 	}
	  else return SendClientMessage(playerid, COLOR_LIME, "Only Law enforcement agents can use this command! ");
	 	return 1;
		}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)