Wierd bug.
#2

Try this, (Not sure about it!)
Code:
CMD:tradecar(playerid, params[])
{
	new id, dif, Float:x, Float:y, Float:z, string[256];
	if(sscanf(params, "rr",id,dif)) return SCM(playerid, COLOR_GRAD2, "Usage: {FFFFFF}/tradecar [playerid] + [difference]");
	if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, -1, "You must be in your vehicle to use this command.");
	if(!IsPlayerInAnyVehicle(id)) return SCM(playerid, -1, "That user must be in his vehicle.");
	if(dif > playerVariables[playerid][pMoney]) return SCM(playerid, -1, "You don't have that much money.");
	new cf[128];
	format(cf, sizeof(cf), "You must wait %d seconds.", Cooldown[playerid]);
	if(Cooldown[playerid] > 0) return SCM(playerid, -1, cf);
	new hiscar = GetPlayerVehicleID(id);
	new mycar = GetPlayerVehicleID(playerid);
	new hid = GetVID(hiscar);
	new mid = GetVID(mycar);
	GetPlayerPos(id, x, y, z);
	if(vehStat[hid][vOwnerID] != playerVariables[id][pInternalID]) return SCM(playerid, -1, "That vehicle is not owned by that user.");
	if(vehStat[mid][vOwnerID] != playerVariables[playerid][pInternalID]) return SCM(playerid, -1, "That vehicle is not owned by you.");
	if(!isnull(dif))
	{
		if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
		{
			MyTrade[playerid] = mycar;
			HisTrade[id] = hiscar;
			format(string, sizeof(string), "New Offer From %s", GetName(playerid));
			SCM(id, 0xFF99311EFF, string);
			format(string, sizeof(string), "%s want's to trade his: %s [%d] | %d days | %d KM | colors: %d - %d", GetName(playerid), VehicleNames[GetVehicleModel(mycar) - 400], vehStat[mid][vID], vehStat[mid][vDays], vehStat[mid][vKM], vehStat[mid][vColor1], vehStat[mid][vColor2]);
			SCM(id, COLOR_YELLOW, string);
			format(string, sizeof(string), "For your: %s [%d] | %d days | %d KM | colors: %d - %d + $%s difference from him.", VehicleNames[GetVehicleModel(hiscar) - 400], vehStat[hid][vID], vehStat[hid][vDays], vehStat[hid][vKM], vehStat[hid][vColor1], vehStat[hid][vColor2], NumberFormat(dif));
			SCM(id, COLOR_YELLOW, string);
			HisMoney[playerid] = dif;
			format(string, sizeof(string), "Use /accept tradecar %d to trade your vehicle for %s's vehicle.", playerid, playerVariables[playerid][pNormalName]);
			SCM(id, COLOR_YELLOW, string);
			SCM(playerid, -1, "Offer has been sent 2.");
			TradeType[playerid] = 2;
		}
		else return SCM(playerid, -1, "You're not near that player.");
	}
	else
	{
		if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
		{
			MyTrade[playerid] = mycar;
			HisTrade[id] = hiscar;
			format(string, sizeof(string), "New Offer From %s", GetName(playerid));
			SCM(id, 0xFF99311EFF, string);
			format(string, sizeof(string), "%s want's to trade his: %s [%d] | %d days | %d KM | colors: %d - %d", GetName(playerid), VehicleNames[GetVehicleModel(mycar) - 400], vehStat[mid][vID], vehStat[mid][vDays], vehStat[mid][vKM], vehStat[mid][vColor1], vehStat[mid][vColor2]);
			SCM(id, COLOR_YELLOW, string);
			format(string, sizeof(string), "For your: %s [%d] | %d days | %d KM | colors: %d - %d", VehicleNames[GetVehicleModel(hiscar) - 400], vehStat[hid][vID], vehStat[hid][vDays], vehStat[hid][vKM], vehStat[hid][vColor1], vehStat[hid][vColor2]);
			SCM(id, COLOR_YELLOW, string);
			format(string, sizeof(string), "Use /accept tradecar %d to trade your vehiclel for %s's vehicle.", playerid, playerVariables[playerid][pNormalName]);
			SCM(id, COLOR_YELLOW, string);
			SCM(playerid, -1, "Offer has been sent.");
			TradeType[playerid] = 1;
		}
		else return SCM(playerid, -1, "You're not near that player.");
	}
	return 1;
}
Reply


Messages In This Thread
Wierd bug. - by danielpalade - 16.07.2016, 21:32
Re: Wierd bug. - by ColdGamePlay - 17.07.2016, 02:34
Re: Wierd bug. - by danielpalade - 18.07.2016, 17:38
Re: Wierd bug. - by IceBilizard - 19.07.2016, 12:12
Re: Wierd bug. - by Konstantinos - 19.07.2016, 12:24

Forum Jump:


Users browsing this thread: 1 Guest(s)