Problem with /uncuff help !
#1

Help I have a problem with /uncuff command this is the script:

Код:
if(strcmp(cmd, "/uncuff", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if(gTeam[playerid] == 2)
			{
			  tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
					if(giveplayerid != INVALID_PLAYER_ID)
					{
					  if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						  if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Uncuff yourself!"); return 1; }
							if(PlayerCuffed[giveplayerid])
							{
							  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
							  format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
								SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
								TogglePlayerControllable(giveplayerid, 1);
								PlayerCuffed[giveplayerid] = 0;
							}
							else
							{
							  SendClientMessage(playerid, COLOR_GREY, " That player isn't Tied up !");
							  return 1;
							}
						}
						else
						{
						  SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
						  return 1;
						}
					}
				}
				else
				{
				  SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
				  return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !");
			}
		}//not connected
		return 1;
	}
The problem is I cant /uncuff someone and it says "You are not a Cop/FBI "
Reply
#2

Quote:
Originally Posted by tunetu
Help I have a problem with /uncuff command this is the script:

Код:
if(strcmp(cmd, "/uncuff", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if(gTeam[playerid] == 2)
			{
			  tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
					if(giveplayerid != INVALID_PLAYER_ID)
					{
					  if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						  if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Uncuff yourself!"); return 1; }
							if(PlayerCuffed[giveplayerid])
							{
							  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
							  format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
								SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* You Uncuffed %s.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
								TogglePlayerControllable(giveplayerid, 1);
								PlayerCuffed[giveplayerid] = 0;
							}
							else
							{
							  SendClientMessage(playerid, COLOR_GREY, " That player isn't Tied up !");
							  return 1;
							}
						}
						else
						{
						  SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
						  return 1;
						}
					}
				}
				else
				{
				  SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
				  return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !");
			}
		}//not connected
		return 1;
	}
The problem is I cant /uncuff someone and it says "You are not a Cop/FBI "
pawn Код:
if(!strcmp(cmd,"/uncuff",true))
{
  if(PlayerInfo[playerid][pMember]!=1||PlayerInfo[playerid][pLeader]!=1) return SendClientMessage(playerid,COLOR_GREY,"You are not a cop");
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /cuff [id]");
  id=ReturnUser(cmd);
  if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"This player isn't connected");
  new Float:x,Float:y,Float:z;
  GetPlayerPos(playerid,x,y,z);
  if(!PlayerToPoint(8,id,x,y,z)) return SendClientMessage(playerid,COLOR_GREY,"This person has to be close enough to you.");
  if(!PlayerCuffed[giveplayerid]) return SendClientMessage(playerid,COLOR_GREY,"Player is already cuffed");
  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  GetPlayerName(playerid, sendername, sizeof(sendername));
  format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
  TogglePlayerControllable(giveplayerid, 1);
  PlayerCuffed[giveplayerid] = 0;
  return 1;
}
Reply
#3

it dos not work
Reply
#4

Oh yeah sec.
pawn Код:
if(!strcmp(cmd,"/uncuff",true))
{
  if(PlayerInfo[playerid][pMember]!=1||PlayerInfo[playerid][pLeader]!=1) return SendClientMessage(playerid,COLOR_GREY,"You are not a cop");
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /cuff [id]");
  id=ReturnUser(cmd);
  if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"This player isn't connected");
  new Float:x,Float:y,Float:z;
  GetPlayerPos(playerid,x,y,z);
  if(!PlayerToPoint(8,id,x,y,z)) return SendClientMessage(playerid,COLOR_GREY,"This person has to be close enough to you.");
  if(!PlayerCuffed[giveplayerid]) return SendClientMessage(playerid,COLOR_GREY,"Player is already cuffed");
  GetPlayerName(id, giveplayer, sizeof(giveplayer));
  GetPlayerName(playerid, sendername, sizeof(sendername));
  format(string, sizeof(string), "* You were Uncuffed by %s.", sendername);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  GameTextForPlayer(id, "~g~Uncuffed", 2500, 3);
  TogglePlayerControllable(id, 1);
  PlayerCuffed[id] = 0;
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)