Raised This Month: $ Target: $400
 0% 

Still feeling like a real idiot...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 16:00   Still feeling like a real idiot...
Reply With Quote #1

Ok guys, thanx for the help so far... but just wondering about the teleport menu, can't seem to get it working.

amx_teleportmenu does nothing

So, that is hopefully my only amxmodx stupid question. But I'm going to go write a script that allows me to heal myself (again, i'm not going to keep this, just trying to figure it all out lol.) So i'll probably have a few questions soon...

EDIT:
And what exactly is the id variable?

Oh yeah, and one more nub question I have... how do I have a multi line message. You know, the message you have shown in amxx.cfg every x seconds? I did this:

// Center typed colored messages (last parameter is a color in RRRGGGBBB format)
amx_imessage "Welcome to %hostname% - The one and only 1337CS Beta Server!" "000255100"
amx_imessage "Testing, Programming, and Brainstorming positions are open!" "000255100"
amx_imessage "For more info contact Smooth Criminal, or another admin! "000255100"

But what that did was play one every x seconds instead of 3 lines instead of displaying all 3 every x seconds.
__________________
"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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 16:43  
Reply With Quote #2

Fun module is required.
__________________
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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 17:24  
Reply With Quote #3

ok, thanx, got that all figured out.. still wondering what the id variable is though? is it ALWAYS the person who typed the command?
__________________
"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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 17:32  
Reply With Quote #4

Yes.
__________________
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 , 17:32  
Reply With Quote #5

Quote:
Originally Posted by BioHazardousWaste
ok, thanx, got that all figured out.. still wondering what the id variable is though? is it ALWAYS the person who typed the command?
In the case of register_clcmd and register_concmd, the first parameter of your function to handle it (whether it be named "id", "index", "catwoman") will be the ID of the player that called the command.
__________________
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 , 18:10  
Reply With Quote #6

oh my god, now i really feel like an idiot.. it's the return of a function... wow... i'm speechless (almost)... *throws he at feet*
__________________
"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 , 19:35  
Reply With Quote #7

Ok, I did pretty well I think.. wrote a heal script without posting and got it to compile . Problem is it doesn't work... not sure what the hell is going on here! I did a debug and i got this error

Quote:
L 04/16/2005 - 19:23:42: [AMXX] Native error in "get_user_aiming" on line 18 (file "phpShJQLn.sma").
Here's the code:
Code:
//Include Files #include <amxmodx> #include <fun> #define MAX_PLAYERS 33 //Initializing Function (main) public plugin_init() {    register_plugin("Heal", "1.00", "Steve0")    register_concmd("17_Heal", "heal") //God damn broken! } public heal() {         new health     new target, bodypart, id         get_user_aiming(id, target, bodypart) //line 18     if (target = 0)     {         health = get_user_health(id)         if(health >= 100)         {             client_print(id, print_chat, "YOU ALREADY HAVE FULL HP!")             return PLUGIN_HANDLED         }         new health = get_user_health(id)         set_user_health(id,health + 10)                 if (get_user_health(id) > 100)          set_user_health(id, 100)         return PLUGIN_HANDLED     }         if ((0 < target <= 31) && (is_user_alive(id)) && (is_user_alive(target)))     {         new name[32], fname[32]         get_user_name(id, name, 31)         get_user_name(target, fname, 31)               health = (get_user_health(target))         if (health >= 100)         {                 client_print(id, print_chat, "%s does not have wounds to be mended at this time", fname)             return PLUGIN_HANDLED         }         health = (get_user_health(target))         set_user_health (target, health + 20)                 health = (get_user_health(target))                 if(health >= 100)         set_user_health (target, 100)                 return PLUGIN_HANDLED     } return PLUGIN_HANDLED     }

Please help.. thanx (for interests sake, I couldn't find that file in my steam directory and subdirectories)
__________________
"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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 19:46  
Reply With Quote #8

Try
Code:
public heal(id) {         new health     new target, bodypart     // .. }
__________________
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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-16-2005 , 19:55  
Reply With Quote #9

Ok, thanx that got rid of the error... but now nothing happens, or nothing appears to happen. Am I correct in assuming it's a logical coding error? On compile I got the following warnings:

/home/groups/amxmodx/tmp/phpkFBMfI.sma(19) : warning 211: possibly unintended assignment

and

/home/groups/amxmodx/tmp/phpkFBMfI.sma(27) : warning 219: local variable "health" shadows a variable at a preceding level

Would one of those two be causing the problem? Also, is there a way to get rid of /home/groups/amxmodx/tmp/phpkFBMfI.sma(57) : warning 217: loose indentation and does it really matter?

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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 20:05  
Reply With Quote #10

Code:
// Line 19 if (target = 0) // Should be if (target == 0) // OR if (!target)
Code:
// Line 27 - You already created that variable new health = get_user_health(id) // So .. -> health = get_user_health(id)

As for your loose-indentation warnings, ignore them (or fix them). Also, you could use Avalanche's online-indenter.
__________________
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
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:52.


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