Problem with car buy command
#5

Код:
if (strcmp(cmdtext, "/purchase", true)==0) 
{

	  if (GetPlayerMoney(playerid) < 15000)
	  {
			return SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Sorry, you don't have enough money to buy a car.");
	  }
	  if (IsPlayerInAnyVehicle(playerid) == 1)
	  {
			SetVehicleToRespawn(ownedcar[playerid]);
			ownedcar[playerid] = GetPlayerVehicleID(playerid);
			dUserSetINT(PlayerName(playerid)).("car",ownedcar[playerid]);
			owner[ownedcar[playerid]] = playerid;
			GivePlayerMoney(playerid,-15000);
			SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: You've bought a new vehicle! We hope you enjoy it!");
		}
		else
		{
	        return SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Please get in a vehicle to buy it.");
		}
		return 1;
}
return 0; //at the end of onplayercommandtext
}
Reply


Messages In This Thread
Problem with car buy command - by Jakku - 05.06.2009, 10:19
Re: Problem with car buy command - by lol2112 - 05.06.2009, 10:29
Re: Problem with car buy command - by MenaceX^ - 05.06.2009, 10:35
Re: Problem with car buy command - by Jakku - 05.06.2009, 10:41
Re: Problem with car buy command - by lol2112 - 05.06.2009, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)