20.11.2013, 19:52
When I write the command / v park the car change paint job :/
Code for ”/v park”:
Code for ”/v park”:
PHP код:
else if(strcmp(x_nr,"park",true) == 0)
{
new Float:x,Float:y,Float:z;
new Float:a;
new carid1;
new getcarid1;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid1 = PlayerInfo[playerid][pPcarkey]; }
else { return 1; }
getcarid1 = GetPlayerVehicleID(playerid);
GetVehiclePos(carid1, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid1, a);
if(IsPlayerInVehicle(playerid,carid1) && CarInfo[carid1][cOwned] == 1)
{
if(PlayerToPoint(185.0,playerid,1718.1554,-1846.4375,13.2976))
{
SCM(playerid, COLOR_WHITE, "Este interzis parcarea masinilor in aceasta zona(Spawn Los Santos) !");
return 1;
}
if(PlayerInfo[playerid][pPcarkey] == 999)
{
SCM(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid1 == carid1)
{
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health < 900) return SendClientMessage(playerid,COLOR_GREY,"Nu iti poti parca masina daca are mai putin de 900 HP(health).");
CarInfo[carid1][cLocationx] = x;
CarInfo[carid1][cLocationy] = y;
CarInfo[carid1][cLocationz] = z;
CarInfo[carid1][cAngle] = a;
format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
OnVehUpdate();
OnPlayerDateUpdate(playerid);
DestroyVehicle(carid1);
//CarInfo[carid1][cColorOne] =
ownedcar[carid1] = CreateVehicle(CarInfo[carid1][cModel],CarInfo[carid1][cLocationx],CarInfo[carid1][cLocationy],CarInfo[carid1][cLocationz],CarInfo[carid1][cAngle],CarInfo[carid1][cColorOne],CarInfo[carid1][cColorTwo],60000);
SetVehicleNumberPlate(getcarid1,CarInfo[carid1][cLicense]);
if(CarInfo[carid1][cPaintjob] != 255)
{
ChangeVehiclePaintjob(carid1, CarInfo[carid1][cPaintjob]);
}
SetVehicleVirtualWorld(carid1, CarInfo[carid1][cVirWorld]);
SetVehicleModifications(carid1);
PutPlayerInVehicle(playerid, carid1, 0);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}