27.06.2016, 20:05
Hello when someone offer me a vehicle and i type /accept vehicle and then it just says SERVER:Unknown Command
but it gives me the car.. But it doesnt say anything else, also it doesnt say to the seller that i accepted the offer
neither does it tell me that i accepted the offer.
but it gives me the car.. But it doesnt say anything else, also it doesnt say to the seller that i accepted the offer
neither does it tell me that i accepted the offer.
pawn Код:
else if(strcmp(x_job,"vehicle",true) == 0)
{
new buyername[MAX_PLAYER_NAME];
if(TrySell[playerid][0]==SCRIPT_PLAYERS) {
SendClientMessage(playerid,COLOR_GRAD2,"No one has offered to sell you their car!");
return 1;
}
new cost=TrySell[playerid][1];
GetPlayerName(playerid,playername,sizeof(playername));
if(GetMoney(playerid)<cost) {
SendClientMessage(playerid,COLOR_GRAD2,"You don't even have enough cash!");
return 1;
}
playaid=TrySell[playerid][0];
if(TrySell[playaid][0]!=playerid) {
SendClientMessage(playerid,COLOR_GRAD2,"This player is offline or not trying to sell to you!");
return 1;
}
if(PlayerInfo[playerid][pCarkey]==SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey]=TrySell[playerid][2];
} else if(PlayerInfo[playerid][pCarkey2]==SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey2]=TrySell[playerid][2];
} else if(PlayerInfo[playerid][pCarkey3]==SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey3]=TrySell[playerid][2];
} else if(PlayerInfo[playerid][pCarkey4]==SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey4]=TrySell[playerid][2];
} else if(PlayerInfo[playerid][pCarkey5]==SCRIPT_CARS) {
PlayerInfo[playerid][pCarkey5]=TrySell[playerid][2];
} else {
SendClientMessage(playerid,COLOR_GRAD2,"You already have 5 vehicles.");
return 1;
}
GetPlayerName(VehicleOffer[playerid], giveplayer, sizeof(giveplayer));
strcpy(CarInfo[TrySell[playerid][2]][cOwner],playername,MAX_PLAYER_NAME);
KillPlayerCarKey(playaid,TrySell[playerid][2]);
GiveMoney(playaid,cost);
GiveMoney(playerid,-cost);
TrySell[playerid][0]=SCRIPT_PLAYERS;
TrySell[playaid][0]=SCRIPT_PLAYERS;
format(string, sizeof(string), "* You bought the %s for $%d from %s.",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],VehiclePrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s accepted your vehicle offer, and the $%d was added to your Bank Account.",sendername,VehiclePrice[playerid]);
SendClientMessage(VehicleOffer[playerid], COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s has accepted the business from %s for $%d", sendername,giveplayer,BizPrice[playerid]);
format(string,sizeof(string),"%s sold their %s to %s, for $%d.",giveplayer,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400],sendername,Comma(VehiclePrice[playerid]));
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(tmp,sizeof(tmp),"%s sells his car to %s for $%i, Car ID %i",buyername,playername,cost,TrySell[playerid][2]); //buyername isn't the buyers name, its the sellers
PayLog(tmp);
VehicleOffer[playerid] = 999;
VehiclePrice[playerid] = 0;
UpdateAccount(playerid);
SaveCars();
return 1;
}