Raised This Month: $ Target: $400
 0% 

Couple of questions to get me started.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gor.d
Junior Member
Join Date: Mar 2004
Location: South Carolina
Old 03-26-2004 , 16:20   Couple of questions to get me started.
Reply With Quote #1

Hello everyone. I've decided to try my hand at learning how these plugins work and to maybe write a few (one day). I've read the tutorials from mod.net and some that I have found links to on this site.

The plugin that I am starting off with is the Say_BS plugin from f117bomb because it's really short.

Code:
/* AMXMOD script.
*
* (c) Copyright 2000-2002, f117bomb
* This file is provided as is (no warranties).
*
*/

#include <amxmod>

new phrase[4][] = { "bs", "bullshit", "bullsh*t", "hack"} 

public say_event(id)
{
	new sid[10]
	num_to_str(id,sid,10)
	new said[192]
	read_args(said,191) 
	
	for(new i = 0 ;i < 4; i += 1)
		if(containi(said,phrase[i]) != -1)
			set_task(1.0,"client",0,sid,10)
}

public client(sid[])
{
	new id = str_to_num(sid)
	engclient_cmd(id,"say", "But then agian, I am a noob...") 
}

public plugin_init()
{
	register_plugin("Say BS","0.3","f117bomb")
	register_clcmd("say","say_event")
	return PLUGIN_CONTINUE
}
Im trying to figure as much of this out on my own as I can so my question for now is what does the line "new sid[10]" do? What does sid mean, and what is the significance of the 10?

Thanks for the help.
Gor.d is offline
Send a message via AIM to Gor.d Send a message via MSN to Gor.d Send a message via Yahoo to Gor.d
 



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 16:51.


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