Raised This Month: $ Target: $400
 0% 

HEY im new


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-[N3wb]- Sonic
Junior Member
Join Date: Jun 2006
Old 06-24-2006 , 09:55   HEY im new
Reply With Quote #1

Hey! Im new at making scripts. Im trying to make(probebly allready exist) a amxx give speed plugin, but i cant get it to work, Ive been reading tuts all over and I still dont get it! can some1 help me in some way?
-[N3wb]- Sonic is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-24-2006 , 12:46   Re: HEY im new
Reply With Quote #2

Use the functionwiki on the amxmodx home page, it really helped me out when I was beginning.

Code:
Float: set_user_maxspeed ( index, [ Float:speed = - 1.0 ] )
__________________
Nick is offline
Send a message via MSN to Nick
-[N3wb]- Sonic
Junior Member
Join Date: Jun 2006
Old 06-24-2006 , 18:48   Re: HEY im new
Reply With Quote #3

ok Ill look at it, thx
-[N3wb]- Sonic is offline
-[N3wb]- Sonic
Junior Member
Join Date: Jun 2006
Old 06-25-2006 , 10:10   Re: HEY im new
Reply With Quote #4

This is what i came up with :

/* Plugin Speedy, Sonic's first script */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Speedy"
#define VERSION "1.0"
#define AUTHOR "Sonic"

public plugin_init() {
register_plugin("Speedy", "1.0", "Sonic")
register_concmd("amx_speedy","do_speed",ADMIN _BAN," user Speeds the specified user")
}

public do_speed(id) {
if (!(get_user_flags(id)&ADMIN_BAN)) {
console_print(id,"[AMXX] No access, buzz off!")
return PLUGIN_HANDLED
}
if (read_argc() == 0) {
console_print(id,"[AMXX] You must specify a user")
return PLUGIN_HANDLED
}
new user[32], uid
read_argv(1,user,32)
uid = find_player("bh",user)
if (uid == 0) {
console_print(id,"[AMXX] Invalid User Id")
return PLUGIN_HANDLED
}
client_cmd(uid,"echo player has got speedy!")
client_cmd(uid,"set_user_maxspeed(index, Float:speed = -1.0)")
console_print(id,"speeded player!")
return PLUGIN_HANDLED
}

i get 4 warnings; loose indentation on line 22, 26, 33 and 36. I use amxx-studio 1.4 to script it!!

what did i do wrong?
-[N3wb]- Sonic is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-25-2006 , 10:50   Re: HEY im new
Reply With Quote #5

Loose indentation warnings simply means that you did not indent your code properly.

Here's an example of properly indented code using my techniques:
Code:
public MyFunction(id) {   // first level of indentation - two spaces or a single tab   new var = random_num(0, 3);   new v4r = random_num(0, 3);   if(var == 1)   {     // second level of indentation since we're going inside an {     client_print(id, print_chat, "The random number was 1");     if(v4r == 1)     {       // third level of indentation - second level       client_print(id, print_chat, "zomg you got a 1 again.. lucky ass");     }   } // now we start unindenting - first level } // until we get down to the final closing curly bracket
Hopefully that made sense. I'm tired.
__________________
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
-[N3wb]- Sonic
Junior Member
Join Date: Jun 2006
Old 06-25-2006 , 12:03   Re: HEY im new
Reply With Quote #6

okey, thanks, Ive did it and Ive got no more warnings just have to see if it works
-[N3wb]- Sonic 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:57.


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