1. Ok im trying to make a simple respawn plugin. When you write amx_spawn "name" i want it to spawn the player, but it doesnt. Whats wrong? Just as you know im going to use this in ns. Can somebody help me? (It compiles, but not work...) Here it is:
Code:
#include <amxmodx>
#include <amxmisc>
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 player = cmd_target(id,arg,2)
if(!player)
return PLUGIN_HANDLED
new name[64];
get_user_name(player,name,63);
client_cmd(player, "spawn")
return PLUGIN_HANDLED
}
2. Another small plugin for ns. What im trying to make is when amx_res "name" "resources to give" is used, that player will get resources (alien players only.) This one wont compile. Somebody have an idea of what i did wrong? Here it is:
Code:
#include <amxmodx>
#include <amxmisc>
#include <ns>
public plugin_init()
{
register_plugin("Give Resources", "1.0", "XunTric")
register_concmd("amx_res", "cmdres", ADMIN_KICK, "<name> <resources to give>")
}
public cmdres(id,level,cid)
{
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,2)
if(!player)
return PLUGIN_HANDLED
new name[64];
get_user_name(player,name,63);
ns_set_res(player, "%s")
client_print(player, print_chat, "The admin gave you %s resources")
return PLUGIN_HANDLED
}