View Single Post
Old 29.01.2009, 13:30   #1
SEKoner
Registered User
 
Join Date: Jul 2005
Posts: 11
Post Trainer-Script Update

Hallo den gtainside Benutzern !

Nach dem Upload hatten mich ein paar wenige Benutzer angeschrieben, ob man nicht ein paar Sachen hinzufügen könnte, wie Jacob auf 100% in Freundschaft und Repekt zu setzen oder den Cheat-Counter auf 0 zurückzusetzen. Dem bin ich zwar nachgekommen, wollte aufgrund einer fehlenden Alice Version für GTA IV v 1.020 aber kein neues Paket schnüren und auf der Hauptseite uploaden. Das Trainer-Script wird aber anscheinend noch von einigen Leuten in Version 1.010 genutzt. An diese Leute richtet sich dieser Fred. Ihr könnt den folgenden Code einfach in die bestehende Trainerlike.lua kopieren. Eine Liste aller Statistik Natives und Floats werde ich bei einem neuen Trainer-Script Pack mit hinzufügen. Damit könnt ihr dann alle Werte selber ändern und anpassen.

Änderungen gegenüber dem Script im Mods-Download auf der Seite:

-Textausgabe optisch angepasst (Schriftgrösse und Position)
-Reset Cheat-Counter eingefügt
-Diverse Statistik Cheats von Spielcharakteren
-Add Rocketllauncher hinzugefügt
-Open locked doors eingefügt

Code:
--Trainee Script 1.0 for Alice Beta 0.2.5 by SEKoner

--Press F1 = Godmode ON
--Press F2 = Add Armour
--Press F3 = Clear Wanted Level
--Press F4 = Repair Car
--Press F5 = Save Game
--Press F6 = Add Money 3754$
--Press F7 = Unlock Bridges
--Press F8 = Reset Cheat-Count
--Press F9 = Spawn Tourismo
--Press F10 = Spawn Police Car
--Press F11 = Spawn FBI Buffalo
--Press F12 = Spawn Annihilator
--Press ALT+F1 = = Godmode OFF
--Press ALT+F2 = = Toggle Water
--Press ALT+F3 = = Toggle Shadows
--Press ALT+F4 = = Exit Game
--Press ALT+F5 = = Unlock Doors
--Press ALT+F6 = = Give Rocketlauncher
--Press CTRL+1 = = Roman 100%
--Press CTRL+2 = = Jacob 100%
--Press CTRL+3 = = Brucie 100%
--Press CTRL+4 = = Packie 100%
--Press CTRL+5 = = Dwayne 100%
--Press CTRL+6 = = Michelle 100%
--Press CTRL+7 = = Kate 100%
--Press CTRL+8 = = Carmen 100%

--globale variablen
 PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, PLAYER_CAR, SAVEDONE, TIMER = 0

function InitScript()
 -- Wake up neo ... wake up .... ;)
 Wait(10000)
end

function WaitForPlayerPoolCreation()
  while (IsPlayerPoolCreated() == 0) do
    Wait(2000)
  end
end

function WaitForValidPlayer()
  PLAYER_CHAR = 0
  repeat 
    CallNative("GET_PLAYER_ID")
	PLAYER_ID = GetIntResult()
	if (PLAYER_ID >= 0) then
	  PushInt(PLAYER_ID)
	  CallNative("CONVERT_INT_TO_PLAYERINDEX")
	  PLAYER_INDEX = GetIntResult()
	  PushInt(PLAYER_INDEX)
      PushVarPtr()	
	  CallNative("GET_PLAYER_CHAR")
	  PLAYER_CHAR = GetIntParam(1)
	  if (PLAYER_CHAR <= 0) then
	    Wait(1000)
	  end  
	end 
  until (PLAYER_CHAR > 0)  
end

function getPlayerCar()
 PLAYER_CAR = 0
 IN_CAR = 0
 repeat
   PushInt(PLAYER_CHAR)
   CallNative("IS_CHAR_IN_ANY_CAR")
   IN_CAR = GetIntResult()
   if(IN_CAR > 0) then
     PushInt(PLAYER_CHAR)
     PushVarPtr()
     CallNative("GET_CAR_CHAR_IS_USING")
     PLAYER_CAR = GetIntParam(1)
   end
   if (PLAYER_CAR <= 0) then
     Wait(1000)
   end
 until (PLAYER_CAR > 0)
end

function SaveGame()
  SAVEDONE = 0
  TIMER = 0
  CallNative("ACTIVATE_SAVE_MENU")
  Wait(1000)
  while (SAVEDONE == 0) and (TIMER < 10000) do
    TIMER = TIMER + 100
	Wait(100)
	CallNative("DID_SAVE_COMPLETE_SUCCESSFULLY")
	SAVEDONE = GetIntResult()
  end
end

function GiveWeapon(Num)
  PushInt(PLAYER_CHAR)
  PushInt(Num)
  CallNative("HAS_CHAR_GOT_WEAPON")
  if (GetIntResult() == 0)
  then
    PushInt(PLAYER_CHAR)
    PushInt(Num)
    PushInt(30000)
    PushInt(0)
    CallNative("GIVE_WEAPON_TO_CHAR")
  else
    PushInt(PLAYER_CHAR)
	PushInt(Num)
	PushInt(30000)
	CallNative("SET_CHAR_AMMO")
  end	
end

-- Text functions

function SetTimerA(val)
PushInt(val)
CallSpecNative("SETTIMERA")
end

function GetTimerATick()
CallSpecNative("TIMERA")
return GetIntResult()
end 

function DisplayText(txt, x, y)
  scale = 0.5
  PushFloat(scale)
  PushFloat(scale)
  CallSpecNative("SET_TEXT_SCALE")
  PushFloat(x)
  PushFloat(y)
  PushStr("STRING")
  PushStr(txt)
  CallSpecNative("DISPLAY_TEXT_WITH_LITERAL_STRING")
end 

function ShowText(msg)
 SetTimerA(0)
 repeat
  DisplayText(msg, 0.04, 0.07)
  Wait(20)
 until (GetTimerATick() > 1000)
end


-- Carspawn functions from Alexander Blade

function GetSpawnCoords()
  PushInt(PLAYER_CHAR)
  PushFloat(0.0)
  PushFloat(5.0)
  PushFloat(0.0)
  PushVarPtr()
  PushVarPtr()
  PushVarPtr()
  CallNative("GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS")
  X = GetFloatParam(4)
  Y = GetFloatParam(5)
  Z = GetFloatParam(6) 
end

function SpawnCar(name)
  PushStr(name)
  CallNative("GET_HASH_KEY")
  hash = GetIntResult()
  PushInt(hash)
  CallSpecNative("REQUEST_MODEL")
  Res = 0
  while Res == 0 do
    PushInt(hash)
    CallSpecNative("HAS_MODEL_LOADED")
    Res = GetIntResult()
  end
  GetSpawnCoords()
  PushInt(hash)
  PushFloat(X)
  PushFloat(Y)
  PushFloat(Z)
  PushVarPtr()
  PushInt(1)
  CallSpecNative("CREATE_CAR")
  CAR_HANDLE = GetIntParam(4)
  PushInt(hash)
  CallSpecNative("MARK_MODEL_AS_NO_LONGER_NEEDED")
  ShowHelpMsg(name) -- can shows not for all cars in this function because model name
  Wait(1000)        -- not always == gxt name
  PushVarNumPtr(1)
  SetIntParam(1, CAR_HANDLE)
  CallSpecNative("MARK_CAR_AS_NO_LONGER_NEEDED") 
  Wait(3000)
end

function ShowHelpMsg(msg) 
  PushStr(msg)
  CallSpecNative("PRINT_HELP")
end

-- hazard lights functions from GAK

function SetHazardlights(carIndex)
 PushInt(carIndex)
 PushInt(1)
 CallNative("SET_VEH_INDICATORLIGHTS")
end

function SetHazardlights1(carIndex)
 PushInt(carIndex)
 PushInt(0)
 CallNative("SET_VEH_INDICATORLIGHTS")
end


-- Cheating Stuff based on A.Blade examples

function MakeGod()
  DO1 = 1
  PushInt(PLAYER_CHAR)
  PushInt(200)
  CallNative("SET_CHAR_HEALTH")
  Wait(300)
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  CallNative("SET_PLAYER_INVINCIBLE")
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  CallNative("SET_PLAYER_NEVER_GETS_TIRED")
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  ShowText("Godmode enabled")
  Wait(300)
end

function EndGod()
  DO1 = 0
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  CallNative("SET_PLAYER_INVINCIBLE")
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  CallNative("SET_PLAYER_NEVER_GETS_TIRED")
  PushInt(PLAYER_INDEX)
  PushInt(DO1)
  Wait(300)
  ShowText("Godmode disabled")
end

function repairCar(playerCar)
   PushInt(playerCar)
   CallNative("FIX_CAR")
  ShowText("Car repaired")
   SetHazardlights(playerCar)
   Wait(500)
   SetHazardlights1(playerCar)
   Wait(500)
   SetHazardlights(playerCar)
   Wait(500)
   SetHazardlights1(playerCar)
   Wait(500)
   SetHazardlights(playerCar)
   Wait(500)
   SetHazardlights1(playerCar)
   Wait(500)
   SetHazardlights(playerCar)
   Wait(500)
   SetHazardlights1(playerCar)
   Wait(300)
end

function GiveArmour()
  PushInt(PLAYER_CHAR)
  PushInt(200)
  CallNative("ADD_ARMOUR_TO_CHAR")
  ShowText("Armour added")
  Wait(300)
end

function ClearWanted()
  PushInt(0)
  CallNative("CLEAR_WANTED_LEVEL")
  ShowText("Wanted-Level cleared")
  Wait(300)
end

function GiveMeMoney()
  PushInt(PLAYER_ID)
  PushInt(3754)
  CallNative("ADD_SCORE")
  ShowText("Money added")
  Wait(300)
end

function UnlockBridges()
  PushInt(363)
  PushInt(3)
  CallNative("SET_INT_STAT")
  ShowText("Bridges unlocked")
  Wait(300)
end

function ResetCheatCount()
  PushInt(259)
  PushInt(0)
  CallNative("SET_INT_STAT")
  ShowText("Cheats-Stat resetted")
  Wait(300)
end

-- Graphical Stuff from ??

function fancyWaterEnable()
  if waterMode == 0 then
    PushInt(0)
    CallNative("ENABLE_FANCY_WATER")
    waterMode = 1
    ShowText("Water invisible")
  else
    PushInt(1)
    CallNative("ENABLE_FANCY_WATER")
    waterMode = 0
    ShowText("Water visible")
  end
  Wait(300)
end

function shadowsEnable()
  if shadowMode == 0 then
    PushInt(1)
    CallNative("ENABLE_SHADOWS")
    shadowMode = 1
    ShowText("Shadows enabled")
  else
    PushInt(0)
    CallNative("ENABLE_SHADOWS")
    shadowMode = 0
    ShowText("Shadows disabled")
  end
end


-- Friend Cheats from SEKoner

function SetRoman()
  P=100
  PushInt(1)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(2)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Roman set to 100%")
  Wait(300)
end

function SetJacob()
  P=100
  PushInt(5)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(6)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Jacob set to 100%")
  Wait(300)
end

function SetBrucie()
  P=100
  PushInt(14)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(15)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Brucie set to 100%")
  Wait(300)
end

function SetDwayne()
  P=100
  PushInt(11)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(12)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Dwayne set to 100%")
  Wait(300)
end

function SetPackie()
  P=100
  PushInt(20)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(21)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Packie set to 100%")
  Wait(300)
end

function SetMichelle()
  P=100
  PushInt(36)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(37)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Michelle set to 100%")
  Wait(300)
end

function SetKate()
  P=100
  PushInt(38)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(39)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Kate set to 100%")
  Wait(300)
end

function SetCarmen()
  P=100
  PushInt(30)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  PushInt(31)
  PushFloat(P)
  CallNative("SET_FLOAT_STAT")
  ShowText("Carmen set to 100%")
  Wait(300)
end


-- Door functions by SgtRiggs90 

function OpenDoor(nameHash, x, y, z, Radius, enableFlag, swingSide)
 Result = 0
 PushFloat(x)
 PushFloat(y)
 PushFloat(z)
 PushFloat(Radius)
 PushInt(nameHash)
 CallSpecNative("DOES_OBJECT_OF_TYPE_EXIST_AT_COORDS")
 Result = GetIntResult()
 if (Result > 0) then
   PushInt(nameHash)
   PushFloat(x)
   PushFloat(y)
   PushFloat(z)
   PushInt(enableFlag)
   PushFloat(swingSide)
   CallSpecNative("SET_STATE_OF_CLOSEST_DOOR_OF_TYPE")
 end
end

function UnlockDoors()
ShowText("Oeffne Tueren ...")
	-- bANK
     	OpenDoor(3863802474, -27.90, -462.90, 15.60, 0.50, 0, 0.0)
     	OpenDoor(866127123, -27.57, -465.90, 16.27, 0.50, 0, 0.0)
     	OpenDoor(3863802474, -27.57, -466.55, 16.27, 0.50, 0, 0.0)
     	OpenDoor(866127123, -27.57, -469.55, 16.27, 0.50, 0, 0.0)
	-- Nikos Hove Beach
	OpenDoor(2181386400, 896.00, -504.00, 15.00, 2.00, 0, 0.00)
	-- Vlad restaurant doors
	OpenDoor(387699963, 943.00, -493.00, 16.00, 2.00, 0, 0.00)
	OpenDoor(387699963, 928.00, -489.00, 16.00, 2.00, 0, 0.00)
     	-- Lawyer building doors
	OpenDoor(4160775174, 79.00, -679.00, 15.00, 0.50, 0, 0.00);
     	OpenDoor(3692801109, 76.00, -679.00, 15.00, 0.50, 0, 0.00);
	OpenDoor(3986654918, 95.00, -682.00, 15.00, 0.50, 0, 0.00);
	OpenDoor(487482787, 95.00, -685.00, 15.00, 0.50, 0, 0.00);
	OpenDoor(2690137464, 120.00, -674.00, 15.00, 1.50, 0, 0.00);
	OpenDoor(4134882193, 80.00, -712.00, 5.00, 1.00, 0, 0.00);
	OpenDoor(4134882193, 71.00, -714.00, 5.00, 1.00, 0, 0.00);
	-- Museums side door
     	OpenDoor(419786306, -97.00, 878.00, 15.00, 1.00, 0, 0.00);
	-- Michelle
	OpenDoor(3477273845, 1197.40, -678.30, 16.70, 0, 0.00);
	-- Faustins Haus
	OpenDoor(3971243973, 947.00, -261.20, 18.50, 0, 1.00);
  Wait(500)
  ShowText("Tueren nun offen")
  
end

-- TEST

function TestCheat()

end

-- Main Functions

function main()
 InitScript()
 while true do
   WaitForPlayerPoolCreation()
   WaitForValidPlayer()
-- F1 ----------------------------- 
   if (IsKeyPressed(112) == 1) then
      if (IsKeyPressed(18) == 1) then
         EndGod()
      else
         MakeGod()
      end
   end
-- F2 ----------------------------- 
   if (IsKeyPressed(113) == 1) then
      if (IsKeyPressed(18) == 1) then
	 fancyWaterEnable()
      else
         GiveArmour()
      end
   end
-- F3 ----------------------------- 
   if (IsKeyPressed(114) == 1) then
      if (IsKeyPressed(18) == 1) then
	 shadowsEnable()
      else
         ClearWanted()
      end
   end
-- F4 ----------------------------- 
   if (IsKeyPressed(115) == 1) then
     getPlayerCar()
     if PLAYER_CAR > 0 then
       repairCar(PLAYER_CAR)
     end
   end
-- F5 ----------------------------- 
   if (IsKeyPressed(116) == 1) then
      if (IsKeyPressed(18) == 1) then
	 UnlockDoors()
      else
         SaveGame()
      end
   end
-- F6 ----------------------------- 
   if (IsKeyPressed(117) == 1) then
     if (IsKeyPressed(18) == 1) then
	 GiveWeapon(18)
     else
         GiveMeMoney()
     end
   end
-- F7 ----------------------------- 
   if (IsKeyPressed(118) == 1) then
     -- if (IsKeyPressed(18) == 1) then
	 -- TestCheat()
     -- else
         UnlockBridges()
     -- end
   end
-- F8 ----------------------------- 
   if (IsKeyPressed(119) == 1) then
      ResetCheatCount()
   end
-- F9 ----------------------------- 
   if (IsKeyPressed(120) == 1) then
      SpawnCar("turismo")
   end
-- F10 ---------------------------- 
   if (IsKeyPressed(121) == 1) then
      SpawnCar("police2")
   end
-- F11 ---------------------------- 
   if (IsKeyPressed(122) == 1) then
      SpawnCar("fbi")
   end
-- F12 ---------------------------- 
   if (IsKeyPressed(123) == 1) then
      SpawnCar("annihilator")
   end
-- CTRL ---------------------------- 
   if (IsKeyPressed(17) == 1) then
      if (IsKeyPressed(49) == 1) then 
	SetRoman()
      end
      if (IsKeyPressed(50) == 1) then 
	SetJacob()
      end
      if (IsKeyPressed(51) == 1) then 
	SetBrucie()
      end
      if (IsKeyPressed(52) == 1) then 
	SetPackie()
      end
      if (IsKeyPressed(53) == 1) then 
	SetDwayne()
      end
      if (IsKeyPressed(54) == 1) then 
	SetMichelle()
      end
      if (IsKeyPressed(55) == 1) then 
	SetKate()
      end
      if (IsKeyPressed(56) == 1) then 
	SetCarmen()
      end
   end
  Wait(1500)
 end
end

main();
Ach ja, ..... Alexander Blades Tools rocken ... nur nicht Rockstar

Last edited by SEKoner; 02.02.2009 at 16:55.
SEKoner is offline   Reply With Quote