Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » problem with lua scripts
Re: problem with lua scripts [message #412667 is a reply to message #412658] Sun, 29 November 2009 23:54 Go to previous messageGo to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma:
Colonel

Hubba wrote on Sun, 29 November 2009 22:48

Haha whoops srry Blush i dont know much about lua.

But anyways could you post your whole function?
And do you have hooks.dll and luaplugin.dll in your servers folder?
Have you added LuaPlugin to your ssgm file?

This should work:
function OnChat(PlayerId, Type, Message, Target)

if Message == "!b rail" then
               if Purchase_Item(Get_GameObj(PlayerId), 600) == 1 then
                  local pos = Get_Position(Get_GameObj(PlayerId))
                  Grant_Powerup(Get_GameObj(PlayerId), "POW_Railgun_Player")
		  Grant_Powerup(Get_GameObj(PlayerId), "CnC_POW_Ammo_ClipMax")
		  InputConsole("cmsg 0,230,57 [Weap-Bot]: %s has bought a railgun.", Get_Player_Name_By_ID(PlayerId))
               else
               InputConsole("ppage %d You Need 600 credits to buy this.", PlayerId)
            end
      end

	return 1
end


SSGM has the lua plugin on it, hooks is in there, no i don't have the misc.ini stuff in there i thought it did it by it self.. i'm going to try this.

Is there anyway to keep people from buying stuff when they are not in there base?

OK so i just tested it and it worked but i had no message's, is that because i had no bot on?

Also i got these errors.

[Error] C:\Westwood\RenegadeFDS\Server\LuaPlugins\Rail.lua:10: attempt to call g
lobal 'InputConsole' (a nil value)
[Error] C:\Westwood\RenegadeFDS\Server\LuaPlugins\Rail.lua:10: attempt to call g
lobal 'InputConsole' (a nil value)
Distrbd21: hmm
Distrbd21 picked up a Health Crate.
[Error] C:\Westwood\RenegadeFDS\Server\LuaPlugins\Rail.lua:8: attempt to call gl
obal 'InputConsole' (a nil value)


I got these when i was trying to buy it and when i bought it.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Mon, 30 November 2009 00:08]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Tutorial]Add moving effects and bone a character
Next Topic: !afk command for lua
Goto Forum:
  


Current Time: Fri Dec 20 00:37:33 MST 2024

Total time taken to generate the page: 0.00721 seconds