SA-MP Forums Archive
Help over /d - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help over /d (/showthread.php?tid=378180)



Help over /d - xXx:FireBlade - 16.09.2012

Hi everybody!

I have a RP mode and it's my own mode i made it! I was fixing something on my command /d or /departments and then sudenly in game if i'm a PD or FBI or SWAT if i type /d it says "USE:/d [text]" and when i use ti "/d How are you?" the chat stays clean nothing apperas no text no chat nothing so the problem is that it is not showing the text for PD,FBI,SWAT and MD!

I'm still useing strcmp

Thank you here is te command!

Код:
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), "{3E3E9F}** (PD)Nacelnik %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "{3E3E9F}** (PD)Kapiten %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "{3E3E9F}** (PD)Porucnik %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "{3E3E9F}** (PD)Narednik %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "{3E3E9F}** (PD)Policajac %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "{3E3E9F}** (PD)Cadet %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "{3E3E9F}** (PD)Policajac %s:{AAAAD4} %s, prijem. **", sendername, result);
				}
				SendTeamMessage(1, 0x42A0A0FF, 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), "{3E3E9F}** (FBI)Director %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "{3E3E9F}** (FBI)Asistent %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "{3E3E9F}** (FBI)Specijalni agent %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "{3E3E9F}** (FBI)Agent %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "{3E3E9F}** (FBI)Cadet %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "{3E3E9F}** (FBI)Pomagac %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "{3E3E9F}** (FBI)Pocetnik %s:{AAAAD4} %s, prijem. **", sendername, result);
				}

				SendTeamMessage(1, 0x42A0A0FF, 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), "{3E3E9F}** (SIPA)General %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "{3E3E9F}** (SIPA)Porucnik %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "{3E3E9F}** (SIPA)Kapiten %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "{3E3E9F}** (SIPA)Major %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "{3E3E9F}** (SIPA)Narednik %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "{3E3E9F}** (SIPA)Cadet %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "{3E3E9F}** (SIPA)Pocetnik %s: {AAAAD4}%s, prijem. **", sendername, result);
				}

				SendTeamMessage(1, 0x42A0A0FF, string);
				printf("%s", string);
				return 1;
			}
			else if(gTeam[playerid] == 1 || PlayerInfo[playerid][pMember]==4 || PlayerInfo[playerid][pLeader]==4)
			{
				  if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "{3E3E9F}** (MD)Director %s: {AAAAD4}%s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "{3E3E9F}** (MD)Doktor %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "{3E3E9F}** (MD)Hirurg %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "{3E3E9F}** (MD)Med. Sestra %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "{3E3E9F}** (MD)Asistent %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "{3E3E9F}** (MD)Stazista %s:{AAAAD4} %s, prijem. **", sendername, result); }
				else
				{
					format(string, sizeof(string), "{3E3E9F}** (MD)Stazista %s:{AAAAD4} %s, prijem. **", sendername, result);
				}

				SendTeamMessage(1, 0x42A0A0FF, string);
				printf("%s", string);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Nisi clan PD,FBI,SIPA!");
				return 1;
			}
		}
		return 1;
	}



Re: Help over /d - seanny - 16.09.2012

Are you apart of the proper team? if not, set your team.


Re: Help over /d - xXx:FireBlade - 16.09.2012

Yes al gteam are set to 2 :S i mean for PD,FBI,SWAT and MD


Re: Help over /d - zDevon - 16.09.2012

Show us your SendTeamMessage stock.


Re: Help over /d - xXx:FireBlade - 16.09.2012

I dont have any stock for SendTeamMessage!

and just to tell you in game it is not showing but here it is :/




Re: Help over /d - xXx:FireBlade - 16.09.2012

bump


Re: Help over /d - xXx:FireBlade - 16.09.2012

bump 2x :S anyone!


Re: Help over /d - trapstar2020 - 16.09.2012

Код:
CMD:d(playerid, params[])
{
	new string[128];
   	if(!IsACop(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer/Government Official.");
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/d)epartments radio [text]");
	if(AntiAdv(playerid, params)) return 1;
	format(string, sizeof(string), "**%s", params);
	foreach(Player, i)
	{
	    if(IsACop(i) || IsAGov(i))
	    {
			SendClientMessage(i, COLOR_DEPTRADIO, string);
	    }
	}
	return 1;
}