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;
}
if (GetPlayerMoney(playerid)<15000) return SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Sorry, you don't have enough money to buy a car.");
Originally Posted by MenaceX^
pawn Код:
|
if (strcmp(cmdtext, "/purchase", true)==0) { if (GetPlayerMoney(playerid) < 15000) { return SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Sorry, you don't have enough money to buy a car."); } 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 { return SendClientMessage(playerid,COLOR_YELLOW,"Car Dealer: Please get in a vehicle to buy it."); } return 1; } return 0; //at the end of onplayercommandtext }