07.03.2012, 18:27
Try this:
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(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; }
Код:
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; }