hihohihohiho Posted February 7, 2008 Share Posted February 7, 2008 How would i create a command like so... /hi it would say "Hello" how would that script look like??? and also where can i find the guide for scripting? Link to comment
Jumba' Posted February 8, 2008 Share Posted February 8, 2008 I guess it'd be like function sayHello ( ) outputChatBox( "Hello", getRootElement(), 255, 255, 255 ) end addCommandHandler( "hi", sayHello ) -edit- btw, here you can find all the scripting functions with great examples on how to use them http://development.mtasa.com/index.php?title=Main_Page Link to comment
hihohihohiho Posted February 8, 2008 Author Share Posted February 8, 2008 I tried that and it comes out with an error: [16:56:32] SCRIPT ERROR: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' [16:56:32] INFO: Loading script failed: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' unexpected symbol near '{' <<<<<<<< Link to comment
Frank-De-Ruiter Posted February 8, 2008 Share Posted February 8, 2008 Ehm what did you change on the script because here there is no } ... ?? Link to comment
Quest Posted February 8, 2008 Share Posted February 8, 2008 LUA doesnt require to use { } only in certain situations. You are thinking of pawno. Link to comment
eAi Posted February 8, 2008 Share Posted February 8, 2008 I'd also point out that you don't need to be creating ZIP based resources. Just use a folder while testing and use zips for release. Link to comment
Quest Posted February 8, 2008 Share Posted February 8, 2008 Yeah, I prefer just to use folders with mine. Dunno why it works well. Link to comment
hihohihohiho Posted February 9, 2008 Author Share Posted February 9, 2008 ok i do the folder then, will the cmd work just in the folder then?!?!? Link to comment
Jumba' Posted February 9, 2008 Share Posted February 9, 2008 ok i do the folder then, will the cmd work just in the folder then?!?!? it should work either way, I dont see what the problem is = / . Link to comment
50p Posted February 9, 2008 Share Posted February 9, 2008 So how come I can't start resource until I create zip file of the resource?! I have got folder of my resource in resourcecache and I try to start resource, what I get back is: [TIME] start: Resource could not be found How can you explain that? Is there some setting in mtaserver.conf which is responsible for that? I guess no, so...? Link to comment
Jumba' Posted February 9, 2008 Share Posted February 9, 2008 So how come I can't start resource until I create zip file of the resource?!I have got folder of my resource in resourcecache and I try to start resource, what I get back is: [TIME] start: Resource could not be found How can you explain that? Is there some setting in mtaserver.conf which is responsible for that? I guess no, so...? resourcecache?! it's supposed to be in %\MTA San Andreas\server\mods\deathmatch\resources There you put the folder, or zip file Link to comment
hihohihohiho Posted February 9, 2008 Author Share Posted February 9, 2008 Once again... [18:52:41] start: Requested by Console [18:52:42] Resource 'Commands 1.0' changed, reloading and starting [18:52:42] Starting Commands 1.0 [18:52:42] SCRIPT ERROR: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' [18:52:42] INFO: Loading script failed: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' [18:52:42] start: Resource 'commands 1.0' started it makes no sence Link to comment
Jumba' Posted February 9, 2008 Share Posted February 9, 2008 Once again...[18:52:41] start: Requested by Console [18:52:42] Resource 'Commands 1.0' changed, reloading and starting [18:52:42] Starting Commands 1.0 [18:52:42] SCRIPT ERROR: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' [18:52:42] INFO: Loading script failed: ...dreas/server/mods/deathmatch/resourcecache/Commands 1.0/commands 1.0.lua:1: unexpected symbol near '{' [18:52:42] start: Resource 'commands 1.0' started it makes no sence this is the only stuff in that file? Link to comment
hihohihohiho Posted February 9, 2008 Author Share Posted February 9, 2008 well i had to make the meta.xml file and that says Link to comment
Quest Posted February 9, 2008 Share Posted February 9, 2008 Post your actual command here. You must have a { somewhere or something in front of it that doesn't make sense. The code Jumba posted will work fine. Do you mind posting it? Link to comment
hihohihohiho Posted February 9, 2008 Author Share Posted February 9, 2008 This is the exact command function sayHello ( ) outputChatBox( "Hello", getRootElement(), 255, 255, 255 ) end addCommandHandler( "hi", sayHello ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now