Raised This Month: $ Target: $400
 0% 

Stepping into the world of CS mods...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 01:39   Stepping into the world of CS mods...
Reply With Quote #1

Hey all

How's it going? First of all, thanx to everyone who's actually doing usefull stuff, such as making AMXMod. So here's my story.... i'm a gr 12 student, computer programming god to be, and casual CS player. So, I got bored and decided well, it's time to start modding CS. So I dug some stuff up, started a dedicated server, downloaded AMX Mod, installed, tested, works fine. Next thing I did, read the Scripting Tutorial. Language is Small, damn, never used that one before. Well it looks close to C++, can't be too hard. So I pulled up the WC3 code and cried. I hate include files with a passion, they make it soo friggin hard to learn a new language. (Functions in different files etc.)

So, this is my long term plan. Have a server running (currently on home pc for testing purposes 24.150.172.213:27015). Write a mod for it, get a good player base, form a clan, and buy an actual server. Let's start at the beginning.. got the test server, now I need to write the code.

If someone will please be my hero and give me a hand, here's what i'm looking for:
a) Any tutorial on the small language, i don't think this is too important because it looks VERY close to C++ so I should be ok
b) A list of things I can do, built in functions, whatever e.x. Change_Player_Health. There's gotta be hundreds of them.
c) Any nicely written and short source code I can study to learn how things work.
d) Any hints, tips, words of advice, things to look out for etc.

As for the type of mod I want to make, i'm not too sure, i've heard lots of ideas; but i'm looking for one that's unique. Just for the hell of it, i'm thinking of having a Martial Arts type of mod to begin with. I probably won't keep this unless people really like it, it will be an exp based mod. Sorta like WC3, but everything changed. Any suggestions, ideas, comments etc. would be appreciated. And thanks in adance.

********************************
You've been hit by a Smooth Criminal!
********************************
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 02:19  
Reply With Quote #2

B) http://amxmodx.org/funcwiki.php ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-16-2005 , 03:06  
Reply With Quote #3

a) http://www.compuphase.com/small.htm (there is a PDF manual)
b) See the post above you
c) Just look at the source for existing plugins in the Plugins forum
d) Don't die
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 04-16-2005 , 03:08  
Reply With Quote #4

e) don't give up
n0obie4life is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 11:06  
Reply With Quote #5

Ok, thanks guys... getting to work now. Wish me luck.
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-16-2005 , 12:00  
Reply With Quote #6

Plugin Return Types: http://forums.alliedmods.net/showthread.php?t=10493
xeroblood is offline
Send a message via MSN to xeroblood
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 12:58  
Reply With Quote #7

The first of many nub questions...

OK, So I decided i'd write a simple script that would tell me (in console) who is playing on my server... This is what I wrote:

Code:
//Include Files
#include <amxmodx>

//Initializing Function (main)
public plugin_init()
{
	register_plugin("FindPlayer", "1.00", "Steve0")
    register_concmd("17_Players", "show_players", ADMIN_CHAT, "{NO ARGS}")
}

public show_players()
{	
	new Players[32]
	new playerCount, i, player
	new strPlayer[32]

	get_players(Players, playerCount)
	for (i=0; i<playerCount; i++)
	{
   		player = Players[i]
   		num_to_str(player, strPlayer[31], 31)
   		client_print (0, print_console, "The following 1337 players are playing now:")
   		client_print (0, print_console, strPlayer)
	}
	PLUGIN_HANDLED	
}
And the results are really weird. In console it says:


] 17_Players
The following 1337 players are playing now:

The following 1337 players are playing now:

The following 1337 players are playing now:

The following 1337 players are playing now:

Unknown command: 17_Players

So, can someone give me a hand? I know there is a function for this already, but I want to write my own to learn the language... thought this would be nice and easy to start with, but apparently not. I want the output to look like this:

The following 1337 players are playing now:
id name steam_id
id name steam_id
id name steam_id
id name steam_id
id name steam_id

(The following 1337 players are playing now: inside the loop was put in for debug purposes, i know it shouldn't be there)

Also, I was wondering how anyone could call this command, i tried removing ADMIN_CHAT but i got errors. Thanx
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-16-2005 , 13:00  
Reply With Quote #8

Code:
//Include Files #include <amxmodx> //Initializing Function (main) public plugin_init() {    register_plugin("FindPlayer", "1.00", "Steve0")     register_concmd("17_Players", "show_players") // now everyone can use it! } public show_players() {        new Players[32]    new playerCount, i, player    new strPlayer[32], strAuthid[32]    client_print (0, print_console, "The following 1337 players are playing now:")    get_players(Players, playerCount)    for (i=0; i<playerCount; i++)    {          player = Players[i]          get_user_name(player,strPlayer,31)          get_user_authid(player,strAuthid,31)          client_print (id, print_console, "#%i - %s - %s",player,strPlayer,strAuthid)    }    PLUGIN_HANDLED     }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 13:16  
Reply With Quote #9

Thaks for the help... and I hate to sound like an asshole, but have you even tried that code? I copy and pasted it directly and got four errors It's really hard trying to learn something when example code doesn't work!

But a few questions about what you have.
Code:
get_user_name(player,strPlayer,31)
get_user_authid(player,strAuthid,31)
I'm going to assume these are built in functions. I tried to find them, but didnt' really know what I was looking for . Isn't there like an excel spreadheet or soemthing of functions? If not i'll make one eventually (DAMN, I hate being nub)

Code:
client_print (0, print_console, "The following 1337 players are playing now:")

client_print (id, print_console, "#%i - %s - %s",player,strPlayer,strAuthid)
Shouldn't they both be id, so it only shows the person who asked? I read this in wc3 code, but I can't get it to work, I always get a compile error. undefined expression id.

Also, what are the % things? I found this:
%s - String
%f - Floating point number
%d - Integer

but what is %i? Thanx again
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 14:22  
Reply With Quote #10

Ok, so nub error on both of our parts. The variable id hadn't been declared Although, that slightly confuses me, because it should be declared wherever it is assigned a value.
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
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 09:51.


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