mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 09:23:21 +00:00
Update scripts / binaries
This commit is contained in:
parent
b42d0ecb46
commit
807dbfd805
16 changed files with 196 additions and 30 deletions
|
@ -12,7 +12,7 @@ int SpawnCar(VariantEntityData entity) {
|
|||
}
|
||||
|
||||
char glassModel[64];
|
||||
strcopy(glassModel, sizeof(glassModel), entity.type);
|
||||
strcopy(glassModel, sizeof(glassModel), entity.model);
|
||||
ReplaceString(glassModel, sizeof(glassModel), ".mdl", "_glass.mdl");
|
||||
if(StrEqual(entity.type, "_car_physics")) {
|
||||
vehicle = CreateProp("prop_physics", entity.model, entity.origin, entity.angles);
|
||||
|
@ -20,9 +20,11 @@ int SpawnCar(VariantEntityData entity) {
|
|||
vehicle = CreateProp("prop_dynamic", entity.model, entity.origin, entity.angles);
|
||||
}
|
||||
if(PrecacheModel(glassModel)) {
|
||||
int glass = CreateProp(glassModel, entity.model, entity.origin, entity.angles);
|
||||
SetVariantString("!activator");
|
||||
AcceptEntityInput(glass, "SetParent", vehicle);
|
||||
int glass = CreateProp("prop_dynamic", glassModel, entity.origin, entity.angles);
|
||||
if(glass != -1) {
|
||||
SetVariantString("!activator");
|
||||
AcceptEntityInput(glass, "SetParent", vehicle);
|
||||
}
|
||||
}
|
||||
SetEntityRenderColor(vehicle, GetRandomInt(0, 255), GetRandomInt(0, 255), GetRandomInt(0, 255));
|
||||
return vehicle;
|
||||
|
|
|
@ -43,7 +43,7 @@ void OpenVariantsMenu(int client) {
|
|||
JSONArray entities;
|
||||
for(int i = 0; i < variants.Length; i++) {
|
||||
varObj = view_as<JSONObject>(variants.Get(i));
|
||||
entities = view_as<JSONArray>(varObj.Get("entities"));
|
||||
entities = varObj.HasKey("entities") ? view_as<JSONArray>(varObj.Get("entities")) : new JSONArray();
|
||||
if(i == g_builder.selectedVariantIndex) {
|
||||
Format(display, sizeof(display), "#%d - %d entities (✔)", i, entities.Length);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue