AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Pluging crashes server (https://forums.alliedmods.net/showthread.php?t=11489)

burcyril10 03-21-2005 02:55

Pluging crashes server
 
Code:
#include <amxmodx> //Should only need amxmodx and tsx #include <amxmisc> #include <fun> #include <tsx> public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_superjump","0")     register_cvar("amx_kungfu","0")     register_event("ResetHUD","cmd_spawn","be") } public cmd_spawn(id) {     if(get_cvar_num("amx_superjump") == 1 && get_cvar_num("amx_kungfu") == 1) {         new ups = ts_createpwup(TSPWUP_SUPERJUMP)         ts_givepwup(id,ups)         ups = ts_createpwup(TSPWUP_KUNGFU)         ts_givepwup(id,ups)         client_print(id,print_chat,"[AMXX]Received free powerups")     } else if(get_cvar_num("amx_superjump") == 1) {         new ups = ts_createpwup(TSPWUP_SUPERJUMP)         ts_givepwup(id,ups)         client_print(id,print_chat,"[AMXX]Received free powerup")     } else {         new ups = ts_createpwup(TSPWUP_KUNGFU)         ts_givepwup(id,ups)         client_print(id,print_chat,"[AMXX]Received free powerup")     } }

please help! I'm probably using the wrong event and if so thats the problem, I need to know when they spawn!

[edit] I should probably add that it crashes WHILE i join, the bar gets about 3/4 of the way and stops, then the ded server crashes. AMXX 1.01, TSX 1.01, TS 2.1, WIN XP HOME DED SERVER [/edit]

nightscreem 03-21-2005 09:14

what if you compile don't you get an error
or if you put ; debug after it in plugins.ini

XxAvalanchexX 03-21-2005 14:00

a) PLUGIN, AUTHOR, and VERSION are never defined.
b) You have to wait a tad bit after creating the powerup before you can give it I believe
c) Are you sure it's this plugin?

Twilight Suzuka 03-21-2005 16:09

WHYA RE YOU DOING IT IN HUDRESET!

burcyril10 03-22-2005 02:36

1. PLUGIN, VERSION, AUTHOR ARE defined, i just didn't put it in.
2. It compiles FINE, its just that whenever its in my plugins.ini (and uncommented) the server crashes when a player joins, therefore its the plugin.
3. I am doing it with hudreset because i don't know of another way

Thats the answers to your questions, now mine ;)
1. Is there a wait function? of should i use set_task? how long should I wait?
2. Is there a better way then with hudreset?

[cTs] Strake*ROC* 03-23-2005 17:40

Quote:

Originally Posted by burcyril10
1. PLUGIN, VERSION, AUTHOR ARE defined, i just didn't put it in.

How can we help you if we dont have the FULL code... Sorry bro, but it helps to have all of the code :)

As in... Ctrl+A, Copy, Paste... :)

Johnny got his gun 03-23-2005 18:48

Lol yes I have a problem. I wrote Half-Life 36, but it crashes on the end boss. Here's part of the code:

Code:

return;
What's wrong?? :oops:

Sp4rt4n 03-23-2005 19:16

oh man,... thats tough jonny...

i dunno if anyone here can fix that one...

burcyril10 03-24-2005 19:42

Quote:

Originally Posted by XxAvalanchexX
a) PLUGIN, AUTHOR, and VERSION are never defined.
b) You have to wait a tad bit after creating the powerup before you can give it I believe
c) Are you sure it's this plugin?

Sorry but you DIDN'T need the definations because 1. It has ABSOLUTETLY nothing to do with it cause i copied that from my other plugins which work and 2. Because Avalanche worked out the problem, so neeer :p


All times are GMT -4. The time now is 14:04.

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