Raised This Month: $ Target: $400
 0% 

Need help with 2 scripts.(ns scripts)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-19-2005 , 17:21   Need help with 2 scripts.(ns scripts)
Reply With Quote #1

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 }
XunTric is offline
 



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:09.


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