SA-MP Forums Archive
[HELP] License command dont work - 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: [HELP] License command dont work (/showthread.php?tid=126519)



[HELP] License command dont work - FreddeN - 08.02.2010

I'm trying to script a license system for my script, this is how it looks like:

Код:
if(strcmp(cmd, "/buycarlicense", true) == 0)
	{
		if(PlayerToPoint(5.0,playerid, 2049.2786,-1899.0490,13.5469))
		{
			if(5000 > GetPlayerMoney(playerid))
			{
				SendClientMessage(playerid, COLOR_GREY, "	You dont have that much.");
				return 1;
			}
			if(PlayerInfo[playerid][DrivingLic] != 1)
			SendClientMessage(playerid, COLOR_WHITE, "Thanks and good luck with your new license.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "	You are not at the DMV.");
		}
		return 1;
	}
I've added

Код:
enum pInfo
{
   DrivingLic,
}
Код:
dini_IntSet(file,"DrivingLic", 0);
Код:
PlayerInfo[playerid][DrivingLic] = dini_Int(file, "DrivingLic");
In my register system and added it to my SaveStats fucntion.

If you can find any errors in the command, please help me out

Thanks


Re: [HELP] License command dont work - akis_tze - 08.02.2010

i m not sure but i think you forget some {
Код:
if(strcmp(cmd, "/buycarlicense", true) == 0)
	{
		if(PlayerToPoint(5.0,playerid, 2049.2786,-1899.0490,13.5469))
		{
			if(5000 > GetPlayerMoney(playerid))
			{
				SendClientMessage(playerid, COLOR_GREY, "	You dont have that much.");
				return 1;
			}
			if(PlayerInfo[playerid][DrivingLic] != 1)
			{
			SendClientMessage(playerid, COLOR_WHITE, "Thanks and good luck with your new license.");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "	You are not at the DMV.");
		}
		return 1;
	}



Re: [HELP] License command dont work - FreddeN - 08.02.2010

Quote:
Originally Posted by KotZ
i m not sure but i think you forget some {
Код:
if(strcmp(cmd, "/buycarlicense", true) == 0)
	{
		if(PlayerToPoint(5.0,playerid, 2049.2786,-1899.0490,13.5469))
		{
			if(5000 > GetPlayerMoney(playerid))
			{
				SendClientMessage(playerid, COLOR_GREY, "	You dont have that much.");
				return 1;
			}
			if(PlayerInfo[playerid][DrivingLic] != 1)
			{
			SendClientMessage(playerid, COLOR_WHITE, "Thanks and good luck with your new license.");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "	You are not at the DMV.");
		}
		return 1;
	}
Sorry, but this didn't help, that it fails to do is, it don't add a "1" on DrivingLic in my ini file and it don't removes the money.