Raised This Month: $ Target: $400
 0% 

Someone teach me SMALL


Post New Thread Reply   
 
Thread Tools Display Modes
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-09-2004 , 16:31  
Reply With Quote #21

well here's my question, do u have a grand idea ur trying to translate into a plugin? if not and u are supposedly the guy who rides the short bus to school then why waste your time? either apply urslef or dont... its upto u
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 05-09-2004 , 16:39  
Reply With Quote #22

at least I can spell things right. I am trying damnit, its not easy. It might be for you, but its not for me.
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-09-2004 , 16:45  
Reply With Quote #23

yeah your right about the spelling u spell pretty good when ur whining for attention, heres something for u to read either way : http://www.compuphase.com/small.htm
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:50  
Reply With Quote #24

ok a simple plugin AMX_FF by JustinHoMi might be a good exmaple (If u don't want me to use your plugin as an example, say so and i'll remove it)

First thing u want to know what the plugin does, so run it, next look at the init
Code:
public plugin_init(){
	register_plugin("Admin FF","0.21","JustinHoMi")
	register_concmd("amx_ff","admin_ff",ADMIN_CVAR,"< 0/1 >")
	register_clcmd("say /ff","check_ff")
	return PLUGIN_CONTINUE
}
register_plugin("Admin FF","0.21","JustinHoMi") is the author's info to put in, register_concmd is a command that the server or a client can run (this is important), register_clcmd is a command that only clients can run (also important). return PLUGIN_CONTINUE means u dont want the plugin to end. PLUGIN_HANDLED means u want it to stop.(You don't need to put a return in the init, so my recommendation is dont)

I'll start easier, the client command(commands are what u would type in console, but pressing a key u also run the command in your console) say /ff, runs check_ff
Code:
public check_ff(id) {
	new ff = get_cvar_num("mp_friendlyfire")
	if(ff == 1)
		client_print(id,print_chat,"[AMXX] Friendly fire is on")
	else if(ff == 0)
		client_print(id,print_chat,"[AMXX] Friendly fire is off")
	return PLUGIN_HANDLED
}
first thing this does is it gets the value of mp_friendlyfire and puts it in the value ff, if ff is 1, friendly fire is on and it tells the client that, if not it tells the client its not on

now the harder one, amx_ff, when u type it in console it runs admin_ff
Code:
public admin_ff(id,level,cid){
	if (!cmd_access(id,level,cid,2))   // I changed this part
      		return PLUGIN_HANDLED 

	new ff_s[2]
	read_argv(1,ff_s,2)
	new ff = str_to_num(ff_s)

	if(ff == 1) {
		server_cmd("mp_friendlyfire 1")
		console_print(id,"[AMXX] Friendly fire is now on")
	}
	else if(ff == 0) {
		server_cmd("mp_friendlyfire 0")
		console_print(id,"[AMXX] Friendly fire is now off")
	}

	return PLUGIN_HANDLED
}
if (!cmd_access(id,level,cid,2)) is used to check if they have access and the correct # of arguments has been entered, if not it kicks them outta the plugin (if they have access, but an incorrect # of arguments. it'll give them the help for the command, but that isn't in this plugin (anymore)) new ff_s[2] is creating a array for input, each character that the admin enter, if they entered 12, takes a place in the array, so that would take 2 spaces. read_argv(1,ff_s,2) is reading in the 1st (notice the 1) argument after the command that the admin has entered, ff_s is where it is being read into, and 2 is the maximum length it can be. new ff = str_to_num(ff_s) changes the array u just read in into a #. The rest u should need help with by now.


Now that i have told u the basics of a plugin, u should be able to understand many of them, any natives (commands sorta) in the plugins u don't understand, look in the includes first, then ask questions on them. Sorry if this didn't help, but i can only try.
Edit: Wow i really coulda wrote a new plugin in that time!
Ingram is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:56  
Reply With Quote #25

Sorry but I'm going to have to throw some links at you , this isn't hard to learn but it isn't something where you sit for three seconds and learn. :

Bail's Scripting Tutorial ( Beta )
Scarzzurs Scripting Tutorial
Small Scripting Tutorial
Google Scripting Tutorial
Peli is offline
Send a message via MSN to Peli
smartsl
Junior Member
Join Date: Apr 2004
Old 05-12-2004 , 23:15  
Reply With Quote #26

http://www.compuphase.com/small.htm
here i find 404 error.

could some one plz tell me where can i get these files:
"The Small toolkit for Microsoft Windows" smallkit.exe
"The Small booklet 1. The Language" smalldoc.pdf
"The Small booklet 2. Implementor's Guide" smallguide.pdf

i can only found some of the files by google, but very old version. i need the latest ver. is there any one can help me?
smartsl is offline
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-13-2004 , 07:33  
Reply With Quote #27

the link works fine.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
smartsl
Junior Member
Join Date: Apr 2004
Old 05-13-2004 , 11:25  
Reply With Quote #28

Quote:
Originally Posted by kingpin
the link works fine.
Just as u say, it's ok now.
smartsl is offline
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 17:56.


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