[Release] Hospital Heal

if you use my code from above change in __resource.lua
server_script “heal.lua” to client_script "heal.lua"

3 Likes

@Streetcorps That was it, changing sever to client works like a charm.

@Streetcorps - works great now - thanks :heart_eyes:

{x= 1839.41, y= 3672.90, z=34.28},{x= -247.76, y= 6331.23, z=32.43},{x= -449.67, y= -340.83, z= 34.50},{x= 357.43, y= -593.36, z= 28.79},{x= 295.83, y= -1446.94, z= 29.97},{x= -676.98, y= 310.68, z= 83.08},{x= 1151.21, y= -1529.62, z= 35.37},{x= -874.64, y= -307.71, z= 39.58}

The locations of all 8 hospitals in San Andreas, in case anyone wants to add them.
1.sandy shores
2. paleto bay
3. rockford
4. pillbox
5. strawberry
6. eclipse
7. st.fiacre
8. portola trinity

6 Likes

@HST well done thanks - :+1: :+1:

1 Like

@Streetcorps anyway to add more Pickups to this resource like weapons etc ??? armor ??

@GanjaMonster

1 Like

UPDATED ---- RESPAWN timer added 60 sec default and all hospitals pickups/blips added

resource.lua------
client_script “heal.lua”

heal.lua-------
Citizen.CreateThread(function()
local hospitalPickup = {
{x= 1839.41, y= 3672.90, z=34.28},
{x= -247.76, y= 6331.23, z=32.43},
{x= -449.67, y= -340.83, z= 34.50},
{x= 357.43, y= -593.36, z= 28.79},
{x= 295.83, y= -1446.94, z= 29.97},
{x= -676.98, y= 310.68, z= 83.08},
{x= 1151.21, y= -1529.62, z= 35.37},
{x= -874.64, y= -307.71, z= 39.58}
}

local hospitals = {
{id=61, x= 1839.6, y= 3672.93, z= 34.28},
{id=61, x= -247.76, y= 6331.23, z=32.43},
{id=61, x= -449.67, y= -340.83, z= 34.50},
{id=61, x= 357.43, y= -593.36, z= 28.79},
{id=61, x= 295.83, y= -1446.94, z= 29.97},
{id=61, x= -676.98, y= 310.68, z= 83.08},
{id=61, x= 1151.21, y= -1529.62, z= 35.37},
{id=61, x= -874.64, y= -307.71, z= 39.58}
}

– Create blips on the map for all the hospitals
for _, map in pairs(hospitals) do
map.blip = AddBlipForCoord(map.x, map.y, map.z)
SetBlipSprite(map.blip, map.id)
SetBlipAsShortRange(map.blip, true)
end

– Spawn the pickup items
for _, item in pairs(hospitalPickup) do
pickup = CreatePickup(GetHashKey(“PICKUP_HEALTH_STANDARD”), item.x, item.y, item.z)
SetPickupRegenerationTime(pickup, 60)
end

end)

8 Likes

@GanjaMonster I think that’s the final piece. Pretty awesome to see a broken script rebuilt by the community.

2 Likes

@HST for this yes , this can also be used for weapons pickups around the map etc by calling the other hashes etc and finding the right weapons id for the icon

1 Like

Is it an custom object? Because I don’t see the health pack, and the script starts up without error’s.

@C0ndor make sure to run it as a CLIENT not SERVER event in the resource client_script heal.lua etc but its a GTA pickup its like a floating medkit in the air

I did @GanjaMonster :slight_smile: and I still don’t see any health package. :frowning:

Yeah I have the latest from Mr.Ganja no ’ at the end.

Isn’t there a sandy shores package at the front in @GanjaMonster version?

on my version its on all hospitals but its the code that u have to manually copy/paste its not in the download or anything , and i did have a type in there that was causing a loop but its been fixed weeks ago so maybe you missed a part of the code ?

I’m double checking everything and I did just copy paste. I don’t even see the blips on the radar, so maybe I have a conflict somewhere.

@COndor could be. It worked fine for me using @Streetcorps method. The pickups just didn’t respawn till I added the code by @GanjaMonster. All is fine on my end.

anyone know how to make that whit vehicle spawn so we can put some secret car in the map ? :scream:

Hey guys!

I’ve this error in the console, screenshot:

Please help me! :slight_smile: