Raised This Month: $ Target: $400
 0% 

Teach me how to make a custom item [TSRP] =]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keVn
Member
Join Date: Jun 2006
Old 06-10-2006 , 19:52   Teach me how to make a custom item [TSRP] =]
Reply With Quote #1

Hey
Can someone give me a guide or explain how I make a custom item
With a function? I want the item to be like using a hamburger.
But instead of restoring your hunger, it announces that your going to do a hit in a special chat.
Like how they have (CNN) (Advert) I want it to be (Hit).
Can someone show me how to do that?
keVn is offline
Des12
Senior Member
Join Date: Jan 2005
Old 06-10-2006 , 20:16  
Reply With Quote #2

5 parts:

Code:
//1: a server command in the init function public plugin_init() {    register_srvcmd("item_hit","item_hit"); } //2: a public function for the item public item_hit() { //3: reading arg to get id    new arg[32];    read_argv(1, arg, 31);    new id = str_to_num(arg);    new name[32];    get_user_name(id, name, 31); //4: printing it out (0 = to everyone, %s = their name)    client_print(0,print_chat,"[Hit] %s is going to do a Hit!",name);    return PLUGIN_HANDLED; }

5: In the sql, make an item, and have the command be:
item_hit <id>
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
keVn
Member
Join Date: Jun 2006
Old 06-10-2006 , 20:44  
Reply With Quote #3

Alright thanks. Wait where do I put the stuff in.. sorry I'm a real noob.
keVn is offline
syke
Junior Member
Join Date: Jul 2005
Old 06-10-2006 , 21:01  
Reply With Quote #4

i think u put it in a notepad then save as "all file types" .sma so like firstplugin.sma and then use the compiler on the website but im not 100% correct
__________________
If you think v3x is a PIMP, paste this into your sig!
syke is offline
Send a message via AIM to syke Send a message via MSN to syke
keVn
Member
Join Date: Jun 2006
Old 06-10-2006 , 21:11  
Reply With Quote #5

Ok I'll try what you said, if it doesn't work I'll just keep posting
keVn is offline
syke
Junior Member
Join Date: Jul 2005
Old 06-10-2006 , 21:12  
Reply With Quote #6

Ok if it works you could give me some Karma
__________________
If you think v3x is a PIMP, paste this into your sig!
syke is offline
Send a message via AIM to syke Send a message via MSN to syke
keVn
Member
Join Date: Jun 2006
Old 06-10-2006 , 21:14  
Reply With Quote #7

Lol uh oh. It doesn't work.. well I don't know if I did anything wrong with the compiler but it gave me this error
Quote:
/home/users/amxmodx/tmp3/textj4ZM3l.sma(4) : error 017: undefined symbol "register_srvcmd"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(13) : error 017: undefined symbol "read_argv"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(14) : error 017: undefined symbol "str_to_num"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(17) : error 017: undefined symbol "get_user_name"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : error 017: undefined symbol "client_print"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : error 001: expected token: ";", but found ")"
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/textj4ZM3l.sma(20) : fatal error 107: too many error messages on one line

Compilation aborted.
8 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textj4ZM3l.amx (compile failed).
Do you know how to fix it :O
keVn is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-10-2006 , 21:27  
Reply With Quote #8

It looks like you forgot to add includes and messed up on some of your indents or something.
Code:
#include <amxmodx> #include <amxmisc> //1: a server command in the init function public plugin_init() {    register_srvcmd("item_hit","item_hit"); } //2: a public function for the item public item_hit() { //3: reading arg to get id    new arg[32];    read_argv(1, arg, 31);    new id = str_to_num(arg);    new name[32];    get_user_name(id, name, 31); //4: printing it out (0 = to everyone, %s = their name)    client_print(0,print_chat,"[Hit] %s is going to do a Hit!",name);    return PLUGIN_HANDLED; }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-10-2006 , 21:28  
Reply With Quote #9

You should look up the sticky about "Helpful Scripting Links" and there's a guide for making a weapon.
Peli is offline
Send a message via MSN to Peli
keVn
Member
Join Date: Jun 2006
Old 06-10-2006 , 21:31  
Reply With Quote #10

Whoot that works. Thanks Six
keVn 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 07:55.


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