AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Script not working? (https://forums.alliedmods.net/showthread.php?t=5334)

_Rustynails_ 08-28-2004 21:35

Script not working?
 
Supposed to work amx_respawn <user>.
I keep getting the errors:

adminspawn.sma(13 -- 14) : error 033: array must be indexed (variable "respawn")
adminspawn.sma(17) : error 017: undefined symbol "spawn"

Please help?
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {   register_plugin("AMX-respawn","0.1","Rustynails")   register_clcmd("amx_respawn","do_respawn",ADMIN_KICK) } public do_respawn(id,level,cid) {   if (!cmd_access(id,level,cid,2))   return PLUGIN_HANDLED   new respawn[32], uid   respawn = read_argv(1,respawn,31)   uid = find_player("bhfl",respawn)   if (!uid) {     spawn(uid)     console_print(id,"[RESPAWN] Spawned successfully.")     } else {     console_print(id,"[RESPAWN] Could not find user.")   }   return PLUGIN_HANDLED }

BAILOPAN 08-28-2004 21:37

You can't just do:
Code:
respawn = read_argv(1, respawn, 31)

respawn is an array, not a normal variable. Just do this:
Code:
read_argv(1, respawn, 31)

Also, make sure you do at the top:
Code:
#include <fun>


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

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