I need help with making /duty colors on LA-RP edit
#1

Ok guys im trying to make a cop get colored name when they go on duty and a different one for FBI,but when i tried to compile,the PWN Compiler crashed.It says "Pawn Compiler library have encountered an error and needs to close" I dont what did wrong? HELP ME

The lines :

Код:
if(OnDuty[playerid]==0)
			    {
			      if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			      {
				  		format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeGivePlayerWeapon(playerid, 24, 100);
						SafeGivePlayerWeapon(playerid, 3, 0);
						SetPlayerArmour(playerid, 100);
						SetPlayerColor(playerid,COP_DUTY_COLOR);
						OnDuty[playerid] = 1;
						}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			      {
				  		format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeGivePlayerWeapon(playerid, 24, 100);
						SafeGivePlayerWeapon(playerid, 3, 0);
						SetPlayerArmour(playerid, 100);
						SetPlayerColor(playerid,FBI_DUTY_COLOR);
						OnDuty[playerid] = 1;
HELP !
Reply
#2

Defined FBI_DUTY_COLOR and/or COP_DUTY_COLOR?
Reply
#3

I defined both of them already.
Reply
#4

Please Post the ENTIRE Code and the error
Reply
#5

as i know there shud be somewhere in that script setplayeteamcolor, un comment the one for the FBI and police and it shud work.
Reply
#6

Quote:
Originally Posted by CueЯvo
Please Post the ENTIRE Code and the error
There is no error,the pwn compiler crashed while compiling! Someone please help me out to figure out this!!
Reply
#7

Ok fine.Heres the code for FBI and cop /duty.There is no error when i tried to compile.The pwn compiler CRASHED.


Код:
//----------------------------------[offduty]-----------------------------------------------
	if(strcmp(cmd, "/duty", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			{
				if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
				{
					if(OnDuty[playerid]==0)
			    {
			      if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
			      {
				  		format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeGivePlayerWeapon(playerid, 24, 100);
						SafeGivePlayerWeapon(playerid, 3, 0);
						SetPlayerArmour(playerid, 100);
						SetPlayerColor(playerid,COP_DUTY_COLOR);
						OnDuty[playerid] = 1;
						}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
			      {
				  		format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeGivePlayerWeapon(playerid, 24, 100);
						SafeGivePlayerWeapon(playerid, 3, 0);
						SetPlayerArmour(playerid, 100);
						SetPlayerColor(playerid,FBI_DUTY_COLOR);
						OnDuty[playerid] = 1;
					}
					else if(OnDuty[playerid]==1)
					{
					  if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
					  {
							format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeResetPlayerWeapons(playerid);
						SetPlayerArmour(playerid, 0);
						SafeGivePlayerWeapon(playerid, 41, 500);
						SetPlayerColor(playerid,TEAM_HIT_COLOR);
						OnDuty[playerid] = 0;
						}
						else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
						{
						  format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
						}
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						SafeResetPlayerWeapons(playerid);
						SetPlayerArmour(playerid, 0);
						SafeGivePlayerWeapon(playerid, 41, 500);
						SetPlayerColor(playerid,TEAM_HIT_COLOR);
						OnDuty[playerid] = 0;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "  You are not in a locker room !");
					return 1;
				}
			}
Reply
#8

try adding this to the top

Код:
Define COP_DUTY_COLOR #00008B
Define FBI_DUTY_COLOR #00008B
Not home so i cant make the right color but fix that self

/Cake
Reply
#9

Cake,i already mentioned above that i defined both FBI_DUTY_COLOR and COP_DUTY_COLOR
Reply
#10

when i get home il do the whole code
EDIT2: You pawno crashes because there is some braces removed or not added il look when i get home.

/Cake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)