SA-MP Forums Archive
[PROBLEM] Radio department not running ! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [PROBLEM] Radio department not running ! (/showthread.php?tid=113038)



[PROBLEM] Radio department not running ! - drawkk - 11.12.2009

Hello everybody

I have a problem.
I 've made this script, but when i type de commands "/r" or "/d" in the chat, there are nothing...

This is the script :

Код:
//=========================Departements des FDL=============================
	if(strcmp(cmd, "/departement", true) == 0 || strcmp(cmd, "/d", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
      new wstring[128];
			new faction = PlayerInfo[playerid][pFaction];
			new rank = PlayerInfo[playerid][pRank];
			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, "[AIDE]: (/d)epartment [departement FDL]");
				return 1;
			}
			if(PlayerInfo[playerid][pFaction] == 0 || PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pFaction] == 10 )
				{
				 		if(rank == 1)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank1],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 2)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank2],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 3)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank3],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 4)
						{
							format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank4],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 5)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank5],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 6)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank6],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 7)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank7],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 8)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank8],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 9)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank9],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 10)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank10],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
						  FactionChatLog(wstring);
						}
					
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "[Erreur] Faction invalide !");
					}
				}
		return 1;
	}
	//=========================Radio des FDL====================================
  	if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			new wstring[128];
			new faction = PlayerInfo[playerid][pFaction];
			new rank = PlayerInfo[playerid][pRank];
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "[Usage:] (/r)adio");
				return 1;
			}
			if(Muted[playerid])
			{
				SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not use the radio, You are muted");
				return 1;
			}
      if(PlayerInfo[playerid][pFaction] == 0 || PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pFaction] == 10 )
				{
				 		if(rank == 1)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank1],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 2)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank2],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 3)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank3],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 4)
						{
							format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank4],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 5)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank5],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 6)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank6],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 7)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank7],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 8)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank8],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 9)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank9],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
				 		else if(rank == 10)
						{
						  format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank10],GetPlayerNameEx(playerid),result);
						  SendFactionTypeMessage(1, COLOR_LSPD, wstring);
						  FactionChatLog(wstring);
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "[Erreur] Faction invalide");
					}
				}
		return 1;
	}

Please, help me, I need you're help


(PS :Sorry for bad english, i'm french, and i speak little english ^^)


Re: [PROBLEM] Radio department not running ! - [HiC]TheKiller - 12.12.2009

Here there, does /department or /radio work?

====================================
Bonjour,

Est-ce que la radio ou d'un dйpartement de travail?





Re: [PROBLEM] Radio department not running ! - drawkk - 12.12.2009

the /r is the police's radio and the /d is the army/police/fbi radio, a departments you understand ?


Re: [PROBLEM] Radio department not running ! - drawkk - 12.12.2009

It's really important, i need you'r help


Re: [PROBLEM] Radio department not running ! - EirikhO - 12.12.2009

But if you type /radio instead of /r does that work?


Re: [PROBLEM] Radio department not running ! - drawkk - 12.12.2009

Yep, i can't see anything.