Raised This Month: $ Target: $400
 0% 

Simple Respawn Script - Internal Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 09-04-2005 , 08:38   Simple Respawn Script - Internal Error
Reply With Quote #1

I was just looking for a simple amx_respawn script but didnt find anything else than trashed bad coded junk.

So I just made my own.

But I get "Internal Error" on both web compiler and my own.
Whats wrong with this?
Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("Player Spawner", "1.0", "XunTric")     register_concmd("amx_spawn", "spawn", ADMIN_KICK, "<name> Spawns a player from death") } public spawn(id, level, cid) {     if (!cmd_access(id, level, cid, 2)) {         return PLUGIN_HANDLED     }     new arg[32]     read_argv(1 ,arg, 31)     new target = cmd_target(id, arg, 2)     if(!target) {         client_print(id, print_console, "Invalid user!")         return PLUGIN_HANDLED     }     if(is_user_alive(target)) {         client_print(id, print_console, "Target is already alive!")         return PLUGIN_HANDLED     }             //Spawn 2 times to avoid bug     set_task(0.5, "dospawn", target)     set_task(0.7, "dospawn", target)     client_print(id, print_console, "Succesfully spawned %s!", target)     return PLUGIN_HANDLED } public dospawn(id) {     spawn(id) }
XunTric is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2005 , 08:51  
Reply With Quote #2

Try changing YOUR spawn() function to something else..
__________________
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
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 09-04-2005 , 08:53  
Reply With Quote #3

Ok I get it.
Spawn is a command and I used it as a function.
Thanks
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-04-2005 , 14:25  
Reply With Quote #4

Don't print "Invalid user!", cmd_target does this for you.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 14:26.


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