dcmd_buycar(playerid, params[])
{
new car;
new carid[256];
format(carid, 256, "%d", GetPlayerVehicleID(playerid));
new confirm[64];
sscanf(params, "s", confirm);
if(strcmp(params, confirm, true) == 0)
{
if(car == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!");
}
else if(car == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You bought this car for $10000, check /vhelp for commands.");
dini_Create(carid);
dini_Set(carid, "name", file);
car = 0;
}
}
else
{
if(GetVehicleModel(playerid) == 404)
{
SendClientMessage(playerid, COLOR_YELLOW, "This car costs $10000, type /buycar confirm to buy it.");
car = 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!");
}
}
return 1;
}
if(GetVehicleModel(playerid) == 404) { SendClientMessage(playerid, COLOR_YELLOW, "This car costs $10000, type /buycar confirm to buy it."); car = 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!"); }
Originally Posted by hanzen
Код:
if(GetVehicleModel(playerid) == 404) { SendClientMessage(playerid, COLOR_YELLOW, "This car costs $10000, type /buycar confirm to buy it."); car = 1; } else { SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!"); } |
Originally Posted by Danand
pawn Код:
|
new carid;
carid = GetPlayerVehicleID(playerid);
Originally Posted by JeNkStAX
Quote:
Just use pawn Код:
|
dcmd_buycar(playerid, params[])
{
new car;
new carid[256];
format(carid, 256, "%d", GetPlayerVehicleID(playerid));
new confirm[64];
sscanf(params, "s", confirm);
if(IsPlayerInAnyVehicle(playerid))
{
if(strcmp(params, "confirm", true) == 0)
{
if(car == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!");
}
else if(car == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You bought this car for $10000, check /vhelp for commands.");
dini_Create(carid);
dini_Set(carid, "name", file);
car = 0;
}
}
else
{
if(GetVehicleModel(playerid) == 404)
{
SendClientMessage(playerid, COLOR_YELLOW, "This car costs $10000, type /buycar confirm to buy it.");
car = 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "This car is not for sale!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "You are'nt in a vehicle!");
}
return 1;
}