Quantcast

Jump to content

» «
Photo

[q]What is wrong?

4 replies to this topic
MaZy.Ger
  • MaZy.Ger

    Player Hater

  • Members
  • Joined: 30 Dec 2008

#1

Posted 13 January 2009 - 08:18 PM Edited by MaZy.Ger, 13 January 2009 - 08:41 PM.

Here my script.

QUOTE
---------- GTA IV Alice----------
---------- © Alexander Blade 2008 & Adhome----------
--global variables
PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, SAVEDONE = 0
SM = 0

function InitScript()
-- blah-blah-blah
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 SetTimeScale()
if (SM == 0) then
  SM = 1
  PushFloat(0.8)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(0.6)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(0.4)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(0.2)
  CallNative("SET_TIME_SCALE")
else
  SM = 0
  PushFloat(0.4)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(0.6)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(0.8)
  CallNative("SET_TIME_SCALE")
  wait(500)
  PushFloat(1.0)
  CallNative("SET_TIME_SCALE")
end
end

function main()
InitScript()
while true do
   if (IsKeyPressed(9) == 1) then
  WaitForPlayerPoolCreation()
     WaitForValidPlayer()
     if (IsKeyPressed(9) == 1) then
    SetTimeScale()
    Wait(200)
  end
   end 
Wait(300)
end
end

-- start
main();

what did i wrong?
It gaves me LUA ERROR 1

skaarlaw
  • skaarlaw

    Square Civilian

  • Members
  • Joined: 22 Dec 2008

#2

Posted 13 January 2009 - 08:21 PM

Checked the syntax of it? i.e. is there an end bracket for every starting one?

Telling us what you intend to do with it may be helpful too.

MaZy.Ger
  • MaZy.Ger

    Player Hater

  • Members
  • Joined: 30 Dec 2008

#3

Posted 13 January 2009 - 08:28 PM

Global variables SM = 0

i wanna have a script to start/stop-slowmotion with TAB. Should be go slowly to slowmotion:
PushFloat(0.8)
CallNative("SET_TIME_SCALE")
wait(500)
PushFloat(0.6)
CallNative("SET_TIME_SCALE")
wait(500)
PushFloat(0.4)
CallNat...
and then after pressing again Tab back again to 1.0 slowly. I have copy this script and paste SET_TIME_SCALE more times.

Intosia
  • Intosia

    I'm random! ^^

  • Members
  • Joined: 11 Dec 2008

#4

Posted 13 January 2009 - 08:35 PM

http://intosia.com/media/timescale.lua

I made this once smile.gif

MaZy.Ger
  • MaZy.Ger

    Player Hater

  • Members
  • Joined: 30 Dec 2008

#5

Posted 13 January 2009 - 08:40 PM

y know that. But what i want is only one Key for 2 thing




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users