Nos most nézem hogy a modba nincs OnVehicleSpawn, és most a LuxAdminnak a /car parancsát írtam át /v re és meg csináltam hogy ne csak adminok használhassák, így jó lenne a jármû spawn csak nem hoz le semmit.
Kimásoltam a Luxból a /v parancsot:
dcmd_v(playerid,params[])
{
if(AccInfo[playerid][Level] >= 0)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp)) return
SendClientMessage(playerid, red, \"Használat: /car [Modell ID/Név] [szin1] [szin2]\") &&
SendClientMessage(playerid, orange, \"Funkciók: Jármûvet Kérhetsz Le\");
new car;
new string[128];
new colour1, colour2;
if(!IsNumeric(tmp))
car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, red, \"Hiba: Nincs Ilyen Jármû ID\");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(AccInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid))
EraseVeh(AccInfo[playerid][pCar]);
new LVehicleID;
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
AccInfo[playerid][pCar] = LVehicleID;
SendCommandToAdmins(playerid,\"Car\");
format(string, sizeof(string), \"%s Le Spawnoltad \\\"%s\\\" (Model:%d) Színek (%d, %d), Pos: X:%0.2f, Y:%0.2f, Z:%0.2f\", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
SaveIn(\"CarSpawns\",string);
format(string, sizeof(string), \"|- Le Spawnoltad \\\"%s\\\" (Model: %d) Színe: %d,%d -|\", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,LIGHTBLUE, string);
}
else return ErrorMessages(playerid, 6);
}
És ki másoltam az összes jármûre vonatkozó részt:
//==============================================================================
// Jármû Spawn/Törlés
//==============================================================================
DelVehicle(vehicleid)
{
for(new players=0;players<=MAX_PLAYERS;players++)
{
new Float:X,Float:Y,Float:Z;
if (IsPlayerInVehicle(players,vehicleid))
{
GetPlayerPos(players,X,Y,Z);
SetPlayerPos(players,X,Y,Z+2);
SetVehicleToRespawn(vehicleid);
}
SetVehicleParamsForPlayer(vehicleid,players,0,1);
}
SetTimerEx(\"VehRes\",3000,0,\"d\",vehicleid);
return 1;
}
public CarSpawner(playerid,model)
{
if(IsPlayerInAnyVehicle(playerid))
SendClientMessage(playerid, red, \"Hiba: Már Van egy Autód\");
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
if(AccInfo[playerid][pCar] != -1)
EraseVeh(AccInfo[playerid][pCar]);
new vehicleid=CreateVehicle(model, x, y, z, angle, -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
ChangeVehicleColor(vehicleid,0,3);
AccInfo[playerid][pCar] = vehicleid;
}
return 1;
}
public EraseVeh(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new Float:X,Float:Y,Float:Z;
if(IsPlayerInVehicle(i, vehicleid))
{
RemovePlayerFromVehicle(i);
GetPlayerPos(i,X,Y,Z);
SetPlayerPos(i,X,Y+3,Z);
}
SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
SetTimerEx(\"VehRes\",1500,0,\"i\",vehicleid);
}
public VehRes(vehicleid)
{
DestroyVehicle(vehicleid);
}
public OnVehicleSpawn(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(vehicleid==AccInfo[pCar])
{
EraseVeh(vehicleid);
AccInfo[pCar]=-1;
}
}
return 1;
}
//==============================================================================