/buydriving not work
#1

Hi, i have the command /buydriving, for buy a driving license, but isnt work:

Код:
if(strcmp(cmd, "/buydriving", true) == 0)
	{
		if(IsPlayerConnected(playerid))
       	{
			if(PlayerToPoint(3.0,playerid,1412.3163,-1701.7324,13.5395))
          	{
            	if(PlayerInfo[playerid][pCarLic] == 0)
				{
				    if(GetPlayerMoney(playerid) < 5000)
				    {
             			SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a driving license");
             			return 1;
					}
					else
					{
             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a driving License for $5000");
             			SafeGivePlayerMoney(playerid, - 5000);
             			PlayerInfo[playerid][pCarLic] = 1;
             			OnPlayerUpdate(playerid);
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a driving license");
					return 1;
				}
			}
		}
  		return 1;
	}
What's wrong?

I was at this coordonates and nothing happened.

When I type /buydriving nothing appear on the chat .
WTF?
Reply
#2

Код:
if(strcmp(cmd, "/buydriving", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		if(PlayerToPoint(3.0,playerid,1412.3163,-1701.7324,13.5395))
        {
			if(PlayerInfo[playerid][pCarLic] == 0)
			{
				if(GetPlayerMoney(playerid) < 5000)
				{
					SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a driving license");
             		return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a driving License for $5000");
             		SafeGivePlayerMoney(playerid, - 5000);
             		PlayerInfo[playerid][pCarLic] = 1;
             		OnPlayerUpdate(playerid);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a driving license");
				return 1;
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not near the license center");
			return 1;
		}
	}
  	return 1;
}
I added another "else" into your script which will tell you if your near that target or not. If the message saying your not close enough keeps showing then there is something clearly wrong with your coordinates

>Untested<
Reply
#3

Hmm i checked the coordonates and you are right. The pickup and the command dont have the same coordonates.

I solved this problem. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)