Re: problem with lua scripts [message #412667 is a reply to message #412658] |
Sun, 29 November 2009 23:54 |
|
Distrbd21
Messages: 743 Registered: September 2008
Karma:
|
Colonel |
|
|
Hubba wrote on Sun, 29 November 2009 22:48 | Haha whoops srry 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
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
[Updated on: Mon, 30 November 2009 00:08] Report message to a moderator
|
|
|