[HELP] License command dont work
#1

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
Reply
#2

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;
	}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)