IsPlayerInVehicle??
#2

Try this:
Код:
if(strcmp(cmdtext, "/carscrap", cmdtext, true) == 0)
{
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 2690.7373,-2225.6082,13.3106)) 
		return SendClientMessage(playerid, COLOR_YELLOW, "You are not at the scrap point");

	if(IsPlayerInVehicle(playerid, 535))
		return SendClientMessage(playerid, COLOR_YELLOW, "You are not in the scrap car");

	GivePlayerMoney(playerid, 2000);
	SendClientMessage(playerid, COLOR_YELLOW, "You've received 2000 bucks for scrapping this car");
	return 1;
}
I increased the range and improved the code. With IsPlayerInVehicle 535 you must to be in vehicle ID 535, to use for vehicle model use
Код:
if(strcmp(cmdtext, "/carscrap", cmdtext, true) == 0)
{
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 2690.7373,-2225.6082,13.3106)) 
		return SendClientMessage(playerid, COLOR_YELLOW, "You are not at the scrap point");

	if(GetVehicleModel(GetPlayerVehicleID(playerid) == 535)
		return SendClientMessage(playerid, COLOR_YELLOW, "You are not in the scrap car");

	GivePlayerMoney(playerid, 2000);
	SendClientMessage(playerid, COLOR_YELLOW, "You've received 2000 bucks for scrapping this car");
	return 1;
}
Reply


Messages In This Thread
IsPlayerInVehicle?? - by Hudgens - 07.03.2012, 18:22
Re: IsPlayerInVehicle?? - by IstuntmanI - 07.03.2012, 18:27

Forum Jump:


Users browsing this thread: 1 Guest(s)