Raised This Month: $ Target: $400
 0% 

respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AAleaderNik
Member
Join Date: Dec 2005
Old 04-06-2006 , 21:30   respawn
Reply With Quote #1

anybody wanna help me/walk me through making a respawn plugin like

amx_respawn nik then i respawn i found a few plugins that had that in it but with alot of other stuff i didnt want and i found one where everybody respawns till the cvar is off but i didnt find one like i wanted
AAleaderNik is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 04-06-2006 , 21:38  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {      register_plugin("Respawn","1.0","Johnjg75")      register_concmd("amx_respawn","dorespawn",ADMIN_SLAY," <player> - Respawns a player") } public dorespawn(id) {      new pplayer[33]      read_argv(1,pplayer, 32)      new iindex = get_user_index( pplayer )      if(!is_user_alive( iindex ))           spawn(iindex)      return PLUGIN_HANDLED }

Not sure if it works but you can try it
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-06-2006 , 21:56  
Reply With Quote #3

Quote:
Originally Posted by johnjg75
Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {      register_plugin("Respawn","1.0","Johnjg75")      register_concmd("amx_respawn","dorespawn",ADMIN_SLAY," <player> - Respawns a player") } public dorespawn(id) {      new pplayer[33]      read_argv(1,pplayer, 32)      new iindex = get_user_index( pplayer )      if(!is_user_alive( iindex ))           spawn(iindex)      return PLUGIN_HANDLED }

Not sure if it works but you can try it
That will not work. You either have to do 2 set_tasks and each one use spawn and then give them their weapons and suit, or do cs_user_spawn(iindex).

A fixed version would look like this:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {      register_plugin("Respawn","1.0","Johnjg75")      register_concmd("amx_respawn","dorespawn",ADMIN_SLAY," <player> - Respawns a player") } public dorespawn(id,level,cid) {      if(!cmd_access(id,level,cid,2))     return PLUGIN_HANDLED          new pplayer[33]      read_argv(1,pplayer, 32)      new iindex = get_user_index( pplayer )      if(!is_user_alive( iindex ))           cs_user_spawn(iindex)            return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
AAleaderNik
Member
Join Date: Dec 2005
Old 04-06-2006 , 22:01  
Reply With Quote #4

well i was just wanted to make them respawn you know like at the begining of the round with the usp or the glock depending on t or ct so this above would work for that?

also

Code:
     new pplayer[33] 
     read_argv(1,pplayer, 32)  
     new iindex = get_user_index( pplayer )  
     if(!is_user_alive( iindex )) 
          cs_user_spawn(iindex) 
       
     return PLUGIN_HANDLED
on new pplayer[33] how do u know to get the number 33 and on the read_argv what does that mean i often see numbers with argv and i dont know where these numbers come from if anyone could explain i would GREATLY appreciate it
AAleaderNik is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-06-2006 , 22:05  
Reply With Quote #5

O_o
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-06-2006 , 22:05  
Reply With Quote #6

Quote:
Originally Posted by AAleaderNik
well i was just wanted to make them respawn you know like at the begining of the round with the usp or the glock depending on t or ct so this above would work for that?

also

Code:
     new pplayer[33] 
     read_argv(1,pplayer, 32)  
     new iindex = get_user_index( pplayer )  
     if(!is_user_alive( iindex )) 
          cs_user_spawn(iindex) 
       
     return PLUGIN_HANDLED
on new pplayer[33] how do u know to get the number 33 and on the read_argv what does that mean i often see numbers with argv and i dont know where these numbers come from if anyone could explain i would GREATLY appreciate it
What? You basically just completely contradicted yourself.

There are many plugins that do what you just said. You said in your original post that you wanted a plugin that would allow you to respawn a target.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 04-06-2006 , 22:08  
Reply With Quote #7

Quote:
on new pplayer[33] how do u know to get the number 33 and on the read_argv what does that mean i often see numbers with argv and i dont know where these numbers come from Sad if anyone could explain i would GREATLY appreciate it

there are 32 player slots max right?

the numbers you store are 0-32 so that is where new pplayer[33] comes from..
0-32 = 33 numbers
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-06-2006 , 22:08  
Reply With Quote #8

clearly Hawks does not understand that he is asking pretty much a COMPLETELY different question that has NOTHING to do with respawning. He is asking what [num] on strings means, and read_argv(id,str,NUM) is.

Edit: Sweaty Banana is EVEN more lost. Someone teach him what a string is O_o

PSS: DEBUG ERRORS BECAUSE get_user_index RETURNED 0 AND YOU TRIED TO SPAWN HIM OMFG
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
AAleaderNik
Member
Join Date: Dec 2005
Old 04-06-2006 , 22:16  
Reply With Quote #9

yes chronic is GOD lol ya i was asking a different question with the agrv but ya the code didnt work like ghw said any other suggestions
AAleaderNik is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-06-2006 , 22:47  
Reply With Quote #10

http://forums.alliedmods.net/showthread.php?t=13987

and 33 means that the player can type up to 33 characters in for the name. IE:
He Wrote:
1234567890123456789012345678901234
We Read:
123456789012345678901234567890123

And names are only allowed to be 32 characters long in HL. So this is genrally why we use new arg1[32]

I dunno why JJG75 deviated and used 33...
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
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 16:34.


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