Код:
#include <a_samp>
#define ORANGE 0xFF5F11FF
#define RED 0xFF0000AA
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fix", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) >= 300)
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
GivePlayerMoney(playerid,-2500);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid, ORANGE, "You have fixed your vehicles for $2500.");
}
else
{
SendClientMessage(playerid,RED,"You don't have enough money to use this command.");
}
}
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(468, x, y, z, 82.2873, 0, 1, 60);
GivePlayerMoney(playerid,-4000);
SendClientMessage(playerid, ORANGE, "You have bought your new vehicle for $4000.");
}
return 1;
}
return 0;
}