Raised This Month: $ Target: $400
 0% 

Errors With My Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 09-09-2004 , 23:27   Errors With My Plugin
Reply With Quote #1

I have my plugin which is

Code:
//--------------------------------------------------------------------------------------------------------------------------- /*UnStick : For KZ Maps * By Dizzy * * * * CVARS unstick * 0/1 * * Client Commands * /unstick * * * Description: * Puts No Clip On Client For 2 Seconds For The Client To Get Out of being stuck in * a checkpoint Teleport * * * Made For KZ Maps * * */ //--------------------------------------------------------------------------------------------------------------------------- #include <amxmodx> #include <fun> #include <engine> //--------------------------------------------------------------------------------------------------------------------------- new bool:isusingunstick = false new bool:canuseunstick = true //--------------------------------------------------------------------------------------------------------------------------- public plugin_init() {     register_plugin("UnStick","1.0","Dizzy")     register_cvar("unstick","1")     register_cvar("unstick_cooldown","60")     register_cvar("unstick_cliptime","2")     register_clcmd("/unstick","unstick")     register_event("ResetHUD","reset","b") } //--------------------------------------------------------------------------------------------------------------------------- public client_connect(id) {     isusingunstick = false     canuseunstick = true } public reset(id) {     canuseunstick = true     isusingunstick = false //--------------------------------------------------------------------------------------------------------------------------- public unstick(id) {     if(!canuseunstick) {     client_print(id, print_chat,"Sorry, you have just recently used unstick please wait until you can again")     }     if(canuseunstick) {     set_user_noclip(id, 1)     set_task(get_cvar_float("unstick_cliptime"),"disable")     }     return PLUGIN_CONTINUE } //--------------------------------------------------------------------------------------------------------------------------- public disable(id) {     set_user_noclip(id)     canuseunstick = false     set_task(get_cvar_float("unstick_cooldown"),"reenable") } public reenable(id) {     canuseunstick = true }

What it does is it give someone no clip for 2 seconds to get out of an area if there stuck like in a false kz_teleport.
You can use it once every 60 seconds!

And I get errors!

here they are

unstick.sma<54> : warning 217: loose indentation
unstick.sma<54> : error 029: incalid expression, assumed zero
unstick.sma<54> : error 017: undefined symbol "unstick"
unstick.sma<66> : error 017: undefined symbol "disable"
unstick.sma<71> : error 029: invalid expression, assumed zero
unstick.sma<71> : error 017: undefined symbol "reenable"
unstick.sma<73> : error 001: expected token: ">", but found "-end of file-"


Can anyone do this / help?! Thanks Please Re-post!
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Votorx
Senior Member
Join Date: Jun 2004
Old 09-10-2004 , 08:11  
Reply With Quote #2

Dude...why don't you take a look at your brackets...

*hint hint* the reset function...
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-10-2004 , 08:13  
Reply With Quote #3

Code:
public reset(id) {     canuseunstick = true     isusingunstick = false

missing brackets.
also these should be arrays
Code:
new bool:isusingunstick = false new bool:canuseunstick = true
Freecode is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 09-10-2004 , 16:41  
Reply With Quote #4

Arrays??? What's that?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-10-2004 , 16:45  
Reply With Quote #5

stuff inside these boxes
[]
example
Code:
new example[32]; // This is an array // Your suppose to look like new bool:isusingunstick[32] = false new bool:canuseunstick[32] = true

If you dont noe how to use array then leanr cuz ur plugin is buggy without them
Freecode is offline
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-10-2004 , 18:21  
Reply With Quote #6

See, if you want to keep track of each player, you're going to want 32 'isusingunstick' and 'canuseunstick' variables.

But it's much easier to do isusingunstick[Player #] than isusingunstick1 isusingunstick2 etc.
Anpheus is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-10-2004 , 18:50  
Reply With Quote #7

Eh I didn't know you need to make bools an array.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 09-10-2004 , 18:51  
Reply With Quote #8

me either
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-10-2004 , 18:56  
Reply With Quote #9

You dont.

*sighs*

Listen, you have thirty-two players

the variable, isusingunstick has only two values. "True" and "False"

So, who is using unstick? You cannot tell. It can only be True or False, it cannot be '32 is True' or '1 is False'.


So when you want to figure out whether a player number n is using unstick, how do you do it?

What if TWO players use unstick at the same time?! You cannot give a single boolean 64 possible values. The most efficient method is bitwise manipulation, in which you could store 32 booleans in a single integer, but that is clearly not the case! Let's think logically.

If two players use it at the same time, you have the same boolean value applying to both players, regardless of whether it is true or not!

Let's think logically!
Anpheus is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 09-10-2004 , 19:37  
Reply With Quote #10

Ehhhh

Arrays Make more errors well, Here is my script

Code:
#include <amxmodx> #include <fun> #include <engine> new bool:isusingunstick = false new bool:canuseunstick = true public plugin_init() {     register_plugin("UnStick","1.0","Dizzy")     register_cvar("unstick","1")     register_cvar("unstick_cooldown","60")     register_cvar("unstick_cliptime","2")     register_clcmd("/unstick","unstick")     register_event("ResetHUD","reset","b") } public client_connect(id) {     isusingunstick = false     canuseunstick = true } public reset(id) {     canuseunstick = true     isusingunstick = false } public unstick(id) {     if(!canuseunstick)     client_print(id, print_chat,"Sorry, you have just recently used unstick please wait until you can again")     }     if(canuseunstick) {     set_user_noclip(id, 1)     set_task(get_cvar_float("unstick_cliptime"),"disable")     return PLUGIN_CONTINUE     } } public disable(id) {     set_user_noclip(id)     canuseunstick = false     set_task(get_cvar_float("unstick_cooldown"),"reenable") } public reenable(id) {     canuseunstick = true }

INvaild Function or Declaration on both

Line 34 and 31

Fix it?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
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 17:17.


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