Raised This Month: $51 Target: $400
 12% 

my very first simple plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 08-19-2004 , 16:02   my very first simple plugin.
Reply With Quote #1

can someone help me? im like a complete noob to SMALL and i was goign to make a plugin that simply said *test*. can someone tell me whats wrong?

Code:
#include <amxmodx> #define amx_testmode public plugin_init() {     register_plugin("First Plugin","0.01","-Snort- Leader")     register_cvar("amx_testmode","0")     register_clcmd("say /test","test",ADMIN_KICK) } public test() {     if(amx_testmode > 0)     set_hudmessage ( 000,255,000 )     show_hudmessage(1,"This is -Snort- Leader's First Plugin")     else     console_print(0,"%s is not set to 0", "amx_testmode")     return PLUGIN_HANDLED     }

i get a problem with the else line, EXPRESSION ASSUMED 0, but in other scripts i see else implenmented like that. as Im startign out scripting, dont complain or insult my lack of skill. I got to start somewhere.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 08-19-2004 , 16:18  
Reply With Quote #2

Here you go , some changes , but no errors. :
Code:
#include <amxmodx> public plugin_init() {    register_plugin("First Plugin","0.01","-Snort- Leader")    register_cvar("amx_testmode","0")    register_clcmd("say /test","test",ADMIN_KICK) } public test() {    if(get_cvar_num("amx_testmode")==1) {      set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.5, 1.5, 4 )      show_hudmessage(0, "Test")        return PLUGIN_HANDLED     }    else {      console_print(0,"amx_testmode is not set to 1 (enabled)")        return PLUGIN_HANDLED     } }
Peli is offline
Send a message via MSN to Peli
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-19-2004 , 16:21  
Reply With Quote #3

Its called {}'s. Use em.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 08-19-2004 , 16:23  
Reply With Quote #4

Yea , whenever you use and if statement and your going to do some code in their , like maybe getting the cvar num , and setting a hud message , you need to use { and }.
Peli is offline
Send a message via MSN to Peli
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 08-19-2004 , 16:29   lol dumb me
Reply With Quote #5

now why diddnt i think of that! lol
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 08-19-2004 , 16:54   cool
Reply With Quote #6

yo i know this plugin is really lame, but when i saw those red letters, it was pretty awesome. thank you!
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 08-19-2004 , 16:56  
Reply With Quote #7

No problem.
Peli is offline
Send a message via MSN to Peli
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 08-20-2004 , 15:15   delete fourm
Reply With Quote #8

any admins going to delete this fourm becuz the issue here has been solved? and i dont wan to take up fourm space...
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 08-20-2004 , 20:33  
Reply With Quote #9

It's a topic , they don't have to , it won't take up space.
Peli is offline
Send a message via MSN to Peli
BillyTheKid
Senior Member
Join Date: Jun 2004
Old 08-21-2004 , 17:28  
Reply With Quote #10

that's what forums are for man there like a really huge faq. Some one asks a question and ppl can help out by answering .
__________________
Select * from * where *=*;
BillyTheKid is offline
Send a message via AIM to BillyTheKid
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode