Car /purchase command problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car /purchase command problem (
/showthread.php?tid=97721)
Car /purchase command problem -
Jakku - 16.09.2009
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?
Re: Car /purchase command problem -
Jakku - 17.09.2009
Anyone can't help me?
Sorry for double post :S
Re: Car /purchase command problem -
Ov3rl0rd - 18.09.2009
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
Re: Car /purchase command problem -
Jakku - 18.09.2009
I see nothing wrong with that.. Other commands works for me with Isplayerinanyvehicle?