AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Will this little thing work? (https://forums.alliedmods.net/showthread.php?t=14044)

CoolKiller 06-07-2005 12:23

Will this little thing work?
 
Will this work?
(aint home, so cant test this on my server. Just want to see if i have made anything right)
Code:

// Hey ya'll out there.. Readin tha plugin are ya?
// This is my first plugin.. Problable VERY simple, but well
// wanted to give "small" programming a try..!
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
        Register_plugin("Showdate", "1.0", "ColKiller")
        register_clcmd("say /date", "tha_date", "admin_all", "Shows date")
        register_clcmd("say_team /date", "tha_date", "admin_all", "Shows date")
        register_clcmd("date", "tha_date", "admin_all", "Shows date")
        register_clcmd("say date", "tha_date", "admin_all", "Shows date")
        register_clcmd("say_team date", "tha_date", "admin_all", "Shows date")
}
Public tha_date
{
        set_hudmessage (red=200, green=100, blue=0, float:x=-1.0, float:y=o.35, effects=0, float:fxtime=6.0)
        show_hudmessage (0,date)
return PLUGIN_HANDLED
}

This is my first time, so please correct my mistakes, and i would like to know what i could change, or any improvements.. (my first script; its not supposed to be super complicated :P)

PM 06-07-2005 13:27

Pretty broken :D (ignoring comments)

Code:
Register_plugin("Showdate", "1.0", "ColKiller")
1) register_plugin <-- It's lowercase
2) You've made a typo in your name

Code:
Public tha_date
1) public <-- it's lowercase again
2) You forgot ()

Code:
set_hudmessage (red=200, green=100, blue=0, float:x=-1.0, float:y=o.35, effects=0, float:fxtime=6.0)
Hrm, don't remember the syntax for this way of specifying arguments, but if there were tags, it is Float and not float.

Code:
show_hudmessage (0,date)
<-- What is date?

Code:
return PLUGIN_HANDLED
You forgot the indentation ;)

Silverice146 06-07-2005 15:06

so wut hes saying is no it will not work

besides all the broken stufffs you need to specify what date is

otherwise it will do nothing, it wont even show the hudmessage i think since theres nothing to show.

CoolKiller 06-07-2005 15:08

Hah :D
 
Maaan.. Well, my signature tells this better than me ^^

CoolKiller 06-07-2005 15:12

HAHAHA :D
 
Quote:

Originally Posted by PM
Pretty broken :D

How is it supposed to look, if its going to work :)?
the date thing, how does "thetime" then work, how can IT fetch the date?

f1del1ty.oXi 06-07-2005 16:19

Why don't you actually take the time to loko at the .sma for the plugin to find out how it does? =\

v3x 06-07-2005 16:32

You should just do somethin like this..

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Showdate", "1.0", "CoolKiller")     register_clcmd("say","hook_say")     register_clcmd("say_team","hook_say")     // Save the extra typing by hooking the 2 say commands } public hook_say(id) {     new message[164]     read_args(message,163)     // Read the 'say' command arguments     // If the message args equal either /date or date ..     if(equali(message,"/date") || equali(message,"date")) {         // Do whatever here..         // return PLUGIN_HANDLED - (here) - Will not display the text that was typed     }     return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 16:50.

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