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 #412658 is a reply to message #412452] Sun, 29 November 2009 21:48 Go to previous messageGo to previous message
Hubba is currently offline  Hubba
Messages: 40
Registered: October 2009
Karma:
Recruit
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

[Updated on: Sun, 29 November 2009 21:58]

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: Sun Dec 15 08:52:27 MST 2024

Total time taken to generate the page: 0.00913 seconds