problem with some script
#1

Hey there. I've got the Underworld RPG script, and i'm working on getting the script bug free as possible. There is 1 things i can't fix or dont get it working.

First:

Код:
if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/d)epartments [department chat]");
				return 1;
			}
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			{
			  if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Chief %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
				}
				SendTeamMessage(2, COLOR_ALLDEPT, string);
				SendTeamMessage(1, COLOR_ALLDEPT, string);
				printf("%s", string);
				return 1;
			}
			else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			{
			  if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Director %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistant Director in Charge %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Special Agent in Charge %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Special Agent %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Special Agent Trainee %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Professional Staff %s: %s, over. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "** Intern %s: %s, over. **", sendername, result);
				}
				SendTeamMessage(2, COLOR_ALLDEPT, string);
				SendTeamMessage(1, COLOR_ALLDEPT, string);
				printf("%s", string);
				return 1;
			}
			else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
			{
			  if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
				}
				SendTeamMessage(2, COLOR_ALLDEPT, string);
				SendTeamMessage(1, COLOR_ALLDEPT, string);
				printf("%s", string);
				return 1;
			}
			else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
			{
				format(string, sizeof(string), "** Paramedic %s: %s, over. **", sendername, result);
				SendTeamMessage(2, COLOR_ALLDEPT, string);
				SendTeamMessage(1, COLOR_ALLDEPT, string);
				printf("%s", string);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  You are not part of a Team !");
				return 1;
			}
		}
		return 1;
	}
This is the code for /d (/departments) where all different departements should be able to talk with each other, but i found a bug which everyone exept the leader of the different appartements can see the chat, and i've been trying everything i've been thinking on, but i can't still get it working. Anyone know how to fix it?

Thanks for the replys

XziPer2007
Reply


Messages In This Thread
problem with some script - by XziPer2007 - 08.07.2009, 00:16
Re: problem with some script - by Correlli - 08.07.2009, 00:20
Re: problem with some script - by XziPer2007 - 08.07.2009, 00:25
Re: problem with some script - by Grim_ - 08.07.2009, 00:28
Re: problem with some script - by XziPer2007 - 08.07.2009, 00:43
Re: problem with some script - by XziPer2007 - 08.07.2009, 15:58
Re: problem with some script - by refshal - 08.07.2009, 16:03
Re: problem with some script - by XziPer2007 - 08.07.2009, 16:07
Re: problem with some script - by refshal - 08.07.2009, 16:19
Re: problem with some script - by XziPer2007 - 08.07.2009, 16:33

Forum Jump:


Users browsing this thread: 2 Guest(s)