05.06.2009, 10:19
Hi!
I have following command:
And when I have enough money and when I'm in vehicle, it appears me only: Unknown Command. If I don't have enough money, it shows me: Car Dealer: Sorry, you don't have enough money to buy a car.
Why it doesn't show this: "Car Dealer: You've bought a new vehicle! We hope you enjoy it!" when I have enough money? While compiling there is no warnings or errors and all things are defined etc...
I have following command:
pawn Код:
if (strcmp(cmdtext, "/purchase", true)==0)
{
if (GetPlayerMoney(playerid) < 15000)
{
SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Sorry, you don't have enough money to buy a car.");
}
else
{
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
{
SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Please get in a vehicle to buy it.");
}
}
return 1;
}
And when I have enough money and when I'm in vehicle, it appears me only: Unknown Command. If I don't have enough money, it shows me: Car Dealer: Sorry, you don't have enough money to buy a car.
Why it doesn't show this: "Car Dealer: You've bought a new vehicle! We hope you enjoy it!" when I have enough money? While compiling there is no warnings or errors and all things are defined etc...