[HELP] /find command problem
#1

Hi guys,

I`m learning pawno, so i`m changeing the GodFather. Now i want to put all the works in factions. I create on for detectives and bodyguard. And i want to put the comand /find to this faction with X rank only.

The NORMAL commando in the GF is this.

Код:
if(strcmp(cmd, "/find", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
		  if(PlayerInfo[playerid][pJob] != 1)
		  {
				SendClientMessage(playerid, COLOR_GREY, "  You are not a Detective !");
				return 1;
		  }
		  if(PlayerOnMission[playerid] > 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "  On a mission right now, can't use this command !");
			  return 1;
			}
			if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You've already searched for someone, wait 2 minutes !");
			  return 1;
			}
		  tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /find [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
			    new points;
			    new level = PlayerInfo[playerid][pDetSkill];
					if(level >= 0 && level <= 50)
					{ points = 4; }
					else if(level >= 51 && level <= 100)
					{ points = 6; }
					else if(level >= 101 && level <= 200)
					{ points = 8; }
					else if(level >= 201 && level <= 400)
					{ points = 10; }
					else if(level >= 401)
					{ points = 12; }
				  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(giveplayerid, X,Y,Z);
					SetPlayerCheckpoint(playerid, X,Y,Z, 6);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					UsedFind[playerid] = 1;
					if(PlayerInfo[playerid][pDetSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 2, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 3, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 4, you are now able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 5, you are now able to find Faction Members."); }
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid Name/ID !");
			}
		}
	  return 1;
	}
And me i put like this:

Код:
if(strcmp(cmd, "/find", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	if (PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) //EPSI
			{
			  if (PlayerInfo[playerid][pRank] == 1 || PlayerInfo[playerid][pRank] == 4 || PlayerInfo[playerid][pRank] == 5)
			  {
				SendClientMessage(playerid, COLOR_GREY, "  You are not a Detective !");
				return 1;
		  	}
		  	return 0;
	  		}
		  if(PlayerOnMission[playerid] > 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "  On a mission right now, can't use this command !");
			  return 1;
			}
			if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You've already searched for someone, wait 2 minutes !");
			  return 1;
			}
		  tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /find [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
			    new points;
			    new level = PlayerInfo[playerid][pDetSkill];
					if(level >= 0 && level <= 50)
					{ points = 4; }
					else if(level >= 51 && level <= 100)
					{ points = 6; }
					else if(level >= 101 && level <= 200)
					{ points = 8; }
					else if(level >= 201 && level <= 400)
					{ points = 10; }
					else if(level >= 401)
					{ points = 12; }
				  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(giveplayerid, X,Y,Z);
					SetPlayerCheckpoint(playerid, X,Y,Z, 6);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					UsedFind[playerid] = 1;
					if(PlayerInfo[playerid][pDetSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 2, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 3, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 4, you are now able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 5, you are now able to find Faction Members."); }
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid Name/ID !");
			}
		}
	  return 1;
	}
But it doesent work. I try changind the == to != like this but nothing.


Код:
if(strcmp(cmd, "/find", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	if (PlayerInfo[playerid][pMember] != 12 || PlayerInfo[playerid][pLeader] != 12) //EPSI
			{
			  if (PlayerInfo[playerid][pRank] != 1 || PlayerInfo[playerid][pRank] != 4 || PlayerInfo[playerid][pRank] != 5)
			  {
				SendClientMessage(playerid, COLOR_GREY, "  You are not a Detective !");
				return 1;
		  	}
		  	return 0;
	  		}
		  if(PlayerOnMission[playerid] > 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "  On a mission right now, can't use this command !");
			  return 1;
			}
			if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You've already searched for someone, wait 2 minutes !");
			  return 1;
			}
		  tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /find [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
			    new points;
			    new level = PlayerInfo[playerid][pDetSkill];
					if(level >= 0 && level <= 50)
					{ points = 4; }
					else if(level >= 51 && level <= 100)
					{ points = 6; }
					else if(level >= 101 && level <= 200)
					{ points = 8; }
					else if(level >= 201 && level <= 400)
					{ points = 10; }
					else if(level >= 401)
					{ points = 12; }
				  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(giveplayerid, X,Y,Z);
					SetPlayerCheckpoint(playerid, X,Y,Z, 6);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					UsedFind[playerid] = 1;
					if(PlayerInfo[playerid][pDetSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 2, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 3, soon you are able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 4, you are now able to find Faction Members."); }
					else if(PlayerInfo[playerid][pDetSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 5, you are now able to find Faction Members."); }
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  Invalid Name/ID !");
			}
		}
	  return 1;
	}
I`m a noob in Pawno, but I know C++, so please, help me.
Someone nows the problem?
The GM compile good, but in game, the command not work for that faction and thar rank, and sometimes, yes for other factions.
Reply
#2

This belongs in the Godfather topic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)