Простая команда для респавна машины за деньги.
Code
else if(strcmp(cmd, "/fixcar", true) == 0)
{
if(PlayerInfo[playerid][pCash] < 5000) return SendClientMessage(playerid, COLOR_WHITE, "Не достаточно денег!");
if(PlayerInfo[playerid][pPhousekey] !=255)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, caridhouse[playerid]))
{
SendClientMessage(playerid, COLOR_GREY,"Ваша машина в угоне!");
return 1;
}
}
new house = PlayerInfo[playerid][pPhousekey];
DestroyVehicle(caridhouse[playerid]);
caridhouse[playerid] = CreateVehicle(PlayerInfo[playerid][pCar], HouseInfo[house][hCarx], HouseInfo[house][hCary], HouseInfo[house][hCarz], HouseInfo[house][hCarc] , PlayerInfo[playerid][pCvet] , HouseInfo[house][hVcol2],5600);
LockCar(caridhouse[playerid]);
createdcar = caridhouse[playerid];
Fuell[caridhouse[playerid]] = PlayerInfo[playerid][pFuelcar];
//Fuell[vehicleid] = 50;
createdcar ++;
GameTextForPlayer(playerid, "~r~$-5000", 5000, 1);
PlayerInfo[playerid][pCash] -= 5000;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"%s.ini",playername);
new File = ini_openFile(string);
ini_getString(File,"Numbercar",string);
//CompVeh(caridhouse[playerid]);
ini_closeFile(File);
SetVehicleNumberPlate(caridhouse[playerid], string);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pKolesocar]);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pNitro]);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pGidra]);
if(PJ(caridhouse[playerid]))
{
ChangeVehiclePaintjob(caridhouse[playerid], PlayerInfo[playerid][pPokraska]);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pSpoiler]);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pBamper1]);
AddVehicleComponent (caridhouse[playerid], PlayerInfo[playerid][pBamper2]);
}
}
return 1;
}