Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Jimmy has modified his spudgun to shoot with significantly more power.
- -- What he found is that his spudgun is now able to do a little more than just knock out his opponents.
- function main()
- -- Let the game start up:
- Wait(500)
- -- Create other threads:
- CreateThread("T_Blip")
- -- Setup:
- gDeadPedNames = {}
- local deadPeds = {}
- local damageScale
- -- Main loop:
- while true do
- -- Process peds:
- for i,ped in {PedFindInAreaXYZ(0,0,0,999999)} do
- if i > 1 and ped ~= gPlayer then
- local name = PedGetName(ped)
- if deadPeds[name] and not PedIsDead(ped) then
- PedSetUniqueModelStatus(PedGetModel(ped),-1)
- PedDelete(ped)
- elseif not deadPeds[name] and PedIsDead(ped) and PedGetWhoHitMeLast(ped) == gPlayer and PedGetLastHitWeapon(ped) == 316 then
- GameSetPedStat(ped,20,0)
- PedPlayHitReaction(ped)
- SoundRemoveAllQueuedSpeech(ped,true)
- deadPeds[name] = true
- table.insert(gDeadPedNames,name)
- PedSetUniqueModelStatus(PedGetModel(ped),-1)
- end
- end
- end
- -- Strong spudgun:
- if PlayerHasWeapon(305) and PedIsPlaying(gPlayer,"/Global/Gun/Gun/Default_KEY",true) then
- -- Give spuds:
- if PedGetAmmoCount(gPlayer,316) < 8 then
- GiveAmmoToPlayer(316,8,false)
- end
- -- Increase damage:
- if not damageScale then
- damageScale = GameGetPedStat(gPlayer,31)
- GameSetPedStat(gPlayer,31,damageScale*10)
- end
- elseif damageScale then
- -- Restore damage:
- GameSetPedStat(gPlayer,31,damageScale)
- damageScale = nil
- end
- -- Wait:
- Wait(0)
- end
- end
- function T_Blip()
- BlipSetShortRanged(BlipAddXYZ(-490.7,314.6,31.4,0,0,1),true)
- while true do
- if PedIsInAreaXYZ(gPlayer,-490.7,314.6,31.4,0.8) and PedMePlaying(gPlayer,"Default_KEY") then
- TextPrintString("Press \b to see dead peds.",0,2)
- Wait(0)
- if IsButtonBeingPressed(9,0) then
- PlayerSetControl(0)
- local s = 1
- repeat
- local text = "R.I.P.\n\n"
- for i=s-3,s+3 do
- if i >= 1 and i <= table.getn(gDeadPedNames) then
- text = text..i..". "..gDeadPedNames[i]
- end
- text = text.."\n"
- end
- TextPrintString(text,0,1)
- TextPrintString("Press \t to exit.",0,2)
- Wait(0)
- if IsButtonBeingPressed(2,0) and s > 1 then
- s = s - 1
- elseif IsButtonBeingPressed(3,0) and s < table.getn(gDeadPedNames) then
- s = s + 1
- end
- until IsButtonBeingPressed(8,0)
- PlayerSetControl(1)
- end
- else
- Wait(0)
- end
- end
- end
- function PedGetModel(ped)
- for m = 0,258 do
- if PedIsModel(ped,m) then
- return m
- end
- end
- end
- -- STimeCycle functions:
- F_AttendedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(false)
- PlayerSetPunishmentPoints(0)
- end
- F_MissedClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- SetSkippedClass(true)
- StatAddToInt(166)
- end
- F_AttendedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrintString("You got home in time for curfew", 4)
- end
- end
- F_MissedCurfew = function()
- if not PedInConversation(gPlayer) and not MissionActive() then
- TextPrint("TM_TIRED5", 4, 2)
- end
- end
- F_StartClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
- end
- F_EndClass = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- F_RingSchoolBell()
- end
- F_StartMorning = function()
- F_UpdateTimeCycle()
- end
- F_EndMorning = function()
- F_UpdateTimeCycle()
- end
- F_StartLunch = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- F_UpdateTimeCycle()
- return
- end
- F_UpdateTimeCycle()
- end
- F_EndLunch = function()
- F_UpdateTimeCycle()
- end
- F_StartAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_EndAfternoon = function()
- F_UpdateTimeCycle()
- end
- F_StartEvening = function()
- F_UpdateTimeCycle()
- end
- F_EndEvening = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_SlightlyTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_Tired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_MoreTired = function()
- F_UpdateTimeCycle()
- end
- F_StartCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndCurfew_TooTired = function()
- F_UpdateTimeCycle()
- end
- F_EndTired = function()
- F_UpdateTimeCycle()
- end
- F_Nothing = function()
- end
- F_ClassWarning = function()
- if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
- return
- end
- local l_23_0 = math.random(1, 2)
- end
- F_UpdateTimeCycle = function()
- if not IsMissionCompleated("1_B") then
- local l_24_0 = GetCurrentDay(false)
- if l_24_0 < 0 or l_24_0 > 2 then
- SetCurrentDay(0)
- end
- end
- F_UpdateCurfew()
- end
- F_UpdateCurfew = function()
- local l_25_0 = shared.gCurfewRules
- if not l_25_0 then
- l_25_0 = F_CurfewDefaultRules
- end
- l_25_0()
- end
- F_CurfewDefaultRules = function()
- local l_26_0 = ClockGet()
- if l_26_0 >= 23 or l_26_0 < 7 then
- shared.gCurfew = true
- else
- shared.gCurfew = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment