Forums Index >> Modding >> How you make mod codes?!?!?!
Page : <1> :
Sigh... I suppose we were all at this point in our tt career...
go here Linky Linky
just so you know, you need to look in the forums before you post...
when you posted this thread, the answer (the link) was at the very top of the list
For those people are posting repeted posts, please take a time to look at this thread:
:::::THE NEW MODDING RESOURCE:::::
- b20
Dash's admin code didn't work for me. I instaled it and put in a pass word, but it didn't work. Help.
I think he meens make New
codes ;)
if that is what you meanthen it gets harder, I havent heard of you before (ive been around for a while) so you are either a newbe or in an alias. If you are a newbe I would not recommend this because even I have only made one code that simply centerprints help to admins. If you are in alias I would recommend that you get OUT of being alias because no one will now you (same if you keep changing your name).
Anyways here it goes
we will use this code (the one I always use to create new codes)
Fig. 1
//------------------------------
// kill a single player by name
//------------------------------
function single_kill(%sender,%target_nm)
{
if(!ClientIsAdmin(%sender,"/ki command failed you are not admin"))
return;
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
If(%client == -1)
{
schedule(1000,false,"CommandToClient",%sender,'CenterPrint',%status_msg,4,4);
return;
}
schedule(1000,false,"centerprintall", %client.nameBase SPC $pref::Server::AdminKillMessage ,4);
%client.player.hurtMe(100);
}
1. First we will Look at Fig. 1
We will have to have an idea what the codes does.
All codes need to start with "function"
The next thing we will look at (see Fig. 2) is the word(s) that follows (if two words are needed use a underscore "_"),
here it is "single_kill" this is where you name your code (see section 6)
Fig.2
function single_kill(%sender,%target_nm)
2. The next line (Fig. 3) shows that is the client IS NOT an admin than return and centerprint the words to the client (the person who types the code in) in parenthesis nothing else will then happen.
Fig.3
if(!ClientIsAdmin(%sender,"/ki command failed you are not admin"))
return;
3. If the client IS admin then do this (Fig. 4) this bascially matches the name of the client so it knows who the action is going to im NOT sure what the "if (%client == -1) does.
Fig. 4
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
If(%client == -1)
{
4. Then it centerprints the status msg (message) (Fig. 5)
Fig. 5
schedule(1000,false,"CommandToClient",%sender,'CenterPrint',%status_msg,4,4);
return;
5. Heres where it gets good ;) this is the main part. This is bascially centerprinting the"AdminKillMessage" from the pref.cs in the dash folder. Then IT REALLY kills the person with "%client.player.hurtme(100);" all codes end with a "}"
Fig. 6
schedule(1000,false,"centerprintall", %client.nameBase SPC $pref::Server::AdminKillMessage ,4);
%client.player.hurtMe(100);
}
6. This is where it acnowledges that it is a code. In the bolded place is where you ALSO put the name of your code DONT FORGET to put it in the line of (Fig. 2)
Fig. 7
else if (%code $="/ki" | %code $= "/kill" )
call("single_kill
",%sender,%a2);
This took 30 mins. To make warfare, art, chilled, anyone who knows this also please correct me where I am wrong I believe I got most of it right though
It looks about right, but I am not at my computer to check it though
Page : <1> :
How do you make Mod codes!?!? (i.e. /light= light tank, etc.)
Mobble