Hi, im making my first lua code, it's very simple, but i get an error:
[CODE]AddCSLuaFile( "test.lua" ) //Include for clients
Msg( "------Save say is working fine!------\n" ) //Is save say loaded?
concommand.Add("say_saved",SS_Say) //The command to do the SS_Say function tasks
local SS_Sav = CreateConVar("save_say", "Hello", FCVAR_NOTIFY) //Command to save what to say in the say_saved command
function SS_Say ( player, command, args ) // The SS_Say function
if player:IsPlayer() and SERVER then //It's a player and the server?
MsgAll( "Important message from server:"..SS_Sav.."\n" ) //Message
else //If he is a client a not the server
Msg( "Sorry, you can't post this message type\n" )// Clients can't use this command
end
end[/CODE]
everything is fine, the save_say command works, the message Save say is working fine! appears but when i put say_saved in the console its supossed to run the function SS_Say, but only appears this message: Unknown Command: say_saved
please help!
Are you running single player, or multiplayer?
currently im testing it in singleplayer
[editline]29th December 2012[/editline]
[QUOTE=Ott;39012193]Are you running single player, or multiplayer?[/QUOTE]
singleplayer
[editline]29th December 2012[/editline]
anyone can help me?
[editline]29th December 2012[/editline]
i tried changing from singleplayer to multiplayer, but doesn't work
function defined after it's called?
[QUOTE=Banana Lord.;39012984]function defined after it's called?[/QUOTE]
OOOH YES!!!! THANK YOU SO MUUCH!!!!!!
Sorry, you need to Log In to post a reply to this thread.