Little bug
#1

For some reason when I type /duty in-game while in a faction(SAFMD), it displays me going on-duty for LSPD too. I can't figure this out.



Код HTML:
CMD:duty(playerid, params[])
{
		new szMessage[256];
		if(FactionCheck(playerid, 1))
		{
			if(!coponduty[playerid])
			{
	        	SetPlayerColor(playerid, COLOR_LSPD);
		        coponduty[playerid] = 1;
		        dutyforcop[playerid] = 1;
				format(szMessage, sizeof(szMessage), "[COP] %s %s has gone on duty.", GetLSPDRank(playerid), GetPlayerNameEx(playerid));
				SendLSPDMessage(COLOR_LSPD, 1, szMessage);
			}
			else
			{
	        	SetPlayerColor(playerid, TRANSPARENT_WHITE);
				ResetPlayerWeapons(playerid);
		        dutyforcop[playerid] = 0;
		        coponduty[playerid] = 0;
				format(szMessage, sizeof(szMessage), "[COP] %s %s has gone off duty", GetLSPDRank(playerid), GetPlayerNameEx(playerid));
				SendSAFMDMessage(COLOR_LSPD, 1, szMessage);
			}
		}
		//----FMD
		if(FactionCheck(playerid, 2))
		{
			if(!firemanonduty[playerid])
			{
	        	SetPlayerColor(playerid, COLOR_SAFMD);
		        firemanonduty[playerid] = 1;
		        dutyforfireman[playerid] = 1;
		        GivePlayerWeapon(playerid,6,1);
		        GivePlayerWeapon(playerid,42,1000);
				format(szMessage, sizeof(szMessage), "[MEDIC] %s %s has gone on duty.", GetSAFMDRank(playerid), GetPlayerNameEx(playerid));
				SendSAFMDMessage(COLOR_SAFMD, 1, szMessage);
			}
			else
			{
	        	SetPlayerColor(playerid, TRANSPARENT_WHITE);
				ResetPlayerWeapons(playerid);
		        dutyforfireman[playerid] = 0;
		        firemanonduty[playerid] = 0;
				format(szMessage, sizeof(szMessage), "[MEDIC] %s %s has gone off duty", GetSAFMDRank(playerid), GetPlayerNameEx(playerid));
				SendSAFMDMessage(COLOR_SAFMD, 1, szMessage);
			}
		}
        return 1;
}
Reply
#2

Can you explain more your bug ?
Thanks
Reply
#3

Quote:
Originally Posted by FilesMAker
Посмотреть сообщение
Can you explain more your bug ?
Thanks
Okay. When I am in the Medic faction and type /duty, it displays a message saying I have gone off duty in LSPD, even though I am not in that faction.
Reply
#4

GetLSPDRank? Why are you getting the data from the LSPD then? Remove it
Reply
#5

else if(FactionCheck(playerid, 2))
or
return 1
or recheck your "FactionCheck(playerid, 2)". It seems always returning true.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)