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)
|
||||
-- Ped Model laden
|
||||
RequestModel(npc.model)
|
||||
while not HasModelLoaded(npc.model) do
|
||||
Wait(1)
|
||||
print("Model is Loading...")
|
||||
local timeout = 0
|
||||
while not HasModelLoaded(npcHash) and timeout < 100 do
|
||||
timeout = timeout + 1
|
||||
print("Warte auf Model-Load...")
|
||||
Wait(100)
|
||||
end
|
||||
|
||||
if not HasModelLoaded(npcHash) then
|
||||
print("Model konnte nicht geladen werden!")
|
||||
return
|
||||
end
|
||||
print("Model erfolgreich geladen, erstelle NPC...")
|
||||
|
||||
-- NPC erstellen
|
||||
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
|
||||
SetEntityAsMissionEntity(npcHandle, true, true)
|
||||
SetBlockingOfNonTemporaryEvents(npcHandle, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue