SA-MP Forums Archive
Command problem - 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: Command problem (/showthread.php?tid=427432)



Command problem - yaron0600 - 01.04.2013

Whats wrong with that Command ?!

Код:
CMD:giveweaponlicense(playerid, params[])
{
	if(IsACop(playerid)
	{
		new string[128], giveplayerid, type;
		if(sscanf(params, "ud", giveplayerid, type))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /givelicense [playerid] [type]");
			SendClientMessageEx(playerid, COLOR_GRAD2, "Types: 1 = Weapon
			return 1;
		}

		if(!IsPlayerConnected(giveplayerid))
		{
			SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
			return 1;
		}
		new year, month, day, hour, minute, second;

		switch(type)
		{

			case 1:
			{
				if(PlayerInfo[giveplayerid][pWeaponLicense] == 1)
				{
					SendClientMessageEx(playerid, COLOR_GRAD2, "This player already has a weapon license.");
					return 1;
				}
				format(string, sizeof(string), "You have given a weapon license to %s.",GetPlayerNameEx(giveplayerid));
				SendClientMessageEx(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "The Officer %s has given you a weapon license.",GetPlayerNameEx(playerid));
				SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
				gettime(hour,minute,second);
				getdate(year,month,day);
				format(string, sizeof(string), "[%d/%d/%d][%d:%d:%d] Officer %s has given a weapon license to %s.",day,month,year,hour,minute,second,GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
				Log("logs/licenses.log", string);
				PlayerInfo[giveplayerid][pWeaponLicense] = 1;
				return 1;
			}



Re: Command problem - Red_Dragon. - 01.04.2013

What do you mean ? please provide more information, do you mean it doesn't work or what ?


Re: Command problem - yaron0600 - 01.04.2013

This is show me errors of Prox...