Car /purchase command problem
#1

Here is my car purchase command

pawn Код:
if (strcmp(cmdtext, "/purchase", true)==0) // To buy a vehicle. (It will say Unknown Command, but anyway it works) ;)
 {

      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)
            {
                ownedcar[playerid] = GetPlayerVehicleID(playerid);
                dUserSetINT(PlayerName(playerid)).("car",ownedcar[playerid]);
                owner[ownedcar[playerid]] = playerid;
                SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Congragulations! You've bought this vehicle for 15000$");
                GivePlayerMoney(playerid,-15000);
            }
            else
            {
          SendClientMessage(playerid,COLOR_YELLOW,"Please get in a vehicle to buy it.");
            }
        }
        return 1;
    }
When I type /purchase and If I don't have 15000$, it says me Car Dealer: Sorry, you don't have enough money to buy a car. When I type this inside of vehicle, it says me Unknown Command. Anyway I bought the car and I can call it with other command. What is the problem?
Reply
#2

Anyone can't help me?

Sorry for double post :S
Reply
#3

Someone correct me if I am wrong, but there is a certain thing that makes it so you can't use commands in a car correct? Or something that you need to add in order to get a cmd to work in a car
Reply
#4

I see nothing wrong with that.. Other commands works for me with Isplayerinanyvehicle?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)