Need help making an MDC with a license check option
#1

Hello everybody, I'm making a police MDC system that will have an option to check people's licenses after they have given them to you with /documents [playerid]. As an example of an MDC, I'm using the command /checklicense. My question is if it's in any way possible to make so that when people /documents [your id], it saves their ID and when you type in /checklicense it automatically check's the person's licenses. What happens now is that if I type /checklicense after somebody has typed /documents, it prints out my information. I hope I didn't confuse you very much, and without further ado, here's the 2 commands:

Код:
new playerl1;
new showeddocuments[MAX_PLAYERS] = 0;

CMD:documents(playerid, params[])
{

	if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /documents [playerid]");
	playerl1 = strval(params);

	if(playerl1 == playerid) return SendClientMessage(playerl1, COLOR_RED, "You can't give documents to yourself!");
	
	new string[128];
	new string1[128];
	new string2[128];
		new string3[128];
	showeddocuments[playerl1] = 1;

	format(string, sizeof(string), "%s's licenses:",GetName(playerid));
	
	format(string1, sizeof(string1), "Name: %s",GetName(playerid));
	
 	format(string2, sizeof(string2), "You have showed your licenses to %s", GetName(playerl1));

 	format(string3, sizeof(string3), "* %s shows their licenses to %s", GetName(playerid), GetName(playerl1));

	SendClientMessage(playerl1, COLOR_YELLOW, string1);
	SendClientMessage(playerid, COLOR_YELLOW, string2);
	ProxDetector(15.0,playerid,string3,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	SendClientMessage(playerl1, COLOR_YELLOW, "Check the documents by going to your cruiser and typing /checklicense!");
	/*}
	else SendClientMessage(playerl1, COLOR_RED, "You must be near the player!");-*/
	
	
	return 1;

}

======================

CMD:checklicense(playerid,params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You have to be in your police vehicle!");
	if (PlayerOrg[playerid] == 4)
	{

	if(showeddocuments[playerl1] == 1)
	{


	new string[128];
	new string1[128];
	new string2[128];
	new string3[128];
	//new string4[128];




	//playerl1 = strval(params);
	format(string, sizeof(string), "%s's licenses:",GetName(playerl1));
	format(string1, sizeof(string1), "Name: %s",GetName(playerl1));
	format(string3, sizeof(string3), "Wanted Level: %d",GetPlayerWantedLevel(playerl1));

	if(licensestatus[playerl1] == 1)
	{
		format(string2, sizeof(string2), "Driving License status: {00FF00}Valid",licensestatus[playerl1]);
	}
	if(licensestatus[playerl1] == 0)
	{
		format(string2, sizeof(string2), "Driving License status: {FF0000}None",licensestatus[playerl1]);
	}
	if(licensestatus[playerl1] == 3)
	{
		format(string2, sizeof(string2), "Driving License status: {FFC233}Revoked",licensestatus[playerl1]);
	}

	//format(string4, sizeof(string4), "You have showed your licenses to %s", GetName(playerl1));

 	//SendClientMessage(playerl1, COLOR_YELLOW, string4);

	SendClientMessage(playerid, COLOR_YELLOW, string);
	SendClientMessage(playerid, COLOR_YELLOW, "------------------");
	SendClientMessage(playerid, COLOR_YELLOW, string1);
	SendClientMessage(playerid, COLOR_YELLOW, string2);
	SendClientMessage(playerid, COLOR_YELLOW, string3);
	SendClientMessage(playerid, COLOR_YELLOW, "------------------");
	showeddocuments[playerl1] = 0;

	}
	}

	return 1;
}
Any help would be very greatly appreciated, thanks for reading!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)