forked from Simnation/Main
[Garage] Print´s add
This commit is contained in:
parent
6ac3871e97
commit
6fcdf2d1d2
1 changed files with 17 additions and 4 deletions
|
@ -15,14 +15,27 @@ end)
|
||||||
function SpawnGuardNPC(npc)
|
function SpawnGuardNPC(npc)
|
||||||
-- Ped Model laden
|
-- Ped Model laden
|
||||||
RequestModel(npc.model)
|
RequestModel(npc.model)
|
||||||
while not HasModelLoaded(npc.model) do
|
local timeout = 0
|
||||||
Wait(1)
|
while not HasModelLoaded(npcHash) and timeout < 100 do
|
||||||
print("Model is Loading...")
|
timeout = timeout + 1
|
||||||
|
print("Warte auf Model-Load...")
|
||||||
|
Wait(100)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not HasModelLoaded(npcHash) then
|
||||||
|
print("Model konnte nicht geladen werden!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
print("Model erfolgreich geladen, erstelle NPC...")
|
||||||
|
|
||||||
-- NPC erstellen
|
-- NPC erstellen
|
||||||
npcHandle = CreatePed(4, npc.model, npc.spawn.x, npc.spawn.y, npc.spawn.x, npc.spawn.w, false, true)
|
npcHandle = CreatePed(4, npc.model, npc.spawn.x, npc.spawn.y, npc.spawn.x, npc.spawn.w, false, true)
|
||||||
print("NPC Sollte stehen!")
|
if not DoesEntityExist(npcHandle) then
|
||||||
|
print("NPC konnte nicht erstellt werden!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
print("NPC erfolgreich erstellt mit Handle: " .. tostring(npcHandle))
|
||||||
-- NPC Eigenschaften setzen
|
-- NPC Eigenschaften setzen
|
||||||
SetEntityAsMissionEntity(npcHandle, true, true)
|
SetEntityAsMissionEntity(npcHandle, true, true)
|
||||||
SetBlockingOfNonTemporaryEvents(npcHandle, true)
|
SetBlockingOfNonTemporaryEvents(npcHandle, true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue