AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple Respawn Script - Internal Error (https://forums.alliedmods.net/showthread.php?t=17572)

XunTric 09-04-2005 08:38

Simple Respawn Script - Internal Error
 
I was just looking for a simple amx_respawn script but didnt find anything else than trashed bad coded junk. :P

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) }

v3x 09-04-2005 08:51

Try changing YOUR spawn() function to something else..

XunTric 09-04-2005 08:53

Ok I get it.
Spawn is a command and I used it as a function.
Thanks :D

XxAvalanchexX 09-04-2005 14:25

Don't print "Invalid user!", cmd_target does this for you.


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

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