Raised This Month: $ Target: $400
 0% 

amx_respawn -- works.. ya.. but only once


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaOs
Senior Member
Join Date: Apr 2004
Old 03-19-2005 , 01:22   amx_respawn -- works.. ya.. but only once
Reply With Quote #1

I made this plugin a few days ago, and it works perfectly, but it only works one time per map load.. I'm guessing its something I haven't decremented but I can't figure it out.. please help

Code:
see next 2 posts
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
KaOs
Senior Member
Join Date: Apr 2004
Old 03-19-2005 , 02:38  
Reply With Quote #2

Edit: I think I figured it out, i'll post updated code if it works
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
KaOs
Senior Member
Join Date: Apr 2004
Old 03-19-2005 , 02:49  
Reply With Quote #3

ill post it as a plugin soon

Code:
#include <amxmodx> #include <amxmisc> #include <fun> new g_respawnCount = -1 new g_respawnIndex[5] public plugin_init(){     register_plugin("AMX Respawn", "1.1", "whitemike")     register_clcmd("amx_respawn", "startRespawn", ADMIN_KICK, " <authid, nick, or #userid> - Respawn a player") } public startRespawn(id) {     if(!access(id, ADMIN_KICK)) {         console_print(id, "[AMXX] You have no access to this command")         return PLUGIN_HANDLED     }     new plrId[33]     read_argv(1, plrId, 32)     new plrIndex = cmd_target(id, plrId, 0)     if(!plrIndex) {         console_print(id, "[AMXX] Cannot find the specified player, try again")         return PLUGIN_HANDLED     }     else if(is_user_alive(plrIndex)) {         console_print(id, "[AMXX] That player is already alive, wait until they die")         return PLUGIN_HANDLED     }     for(new i=0; i<5; i++) {         if(g_respawnIndex[i] == plrIndex) {             console_print(id, "[AMXX] This player is already in queue for respawn")             return PLUGIN_HANDLED         }     }     if(g_respawnCount == 4) {         console_print(id, "[AMXX] There is too many players in the queue (5 max)")         return PLUGIN_HANDLED     }     g_respawnCount++     g_respawnIndex[g_respawnCount] = plrIndex     spawn(plrIndex)     set_task(0.5, "finishRespawn")     if(plrIndex != id) {         new adminName[33]         get_user_name(id, adminName, 32)         new clientName[33]         get_user_name(plrIndex, clientName, 32)         client_print(plrIndex, print_chat, "[AMXX] %s has granted you an extra life!", adminName)         console_print(id, "[AMXX] %s has been respawned successfully", clientName)     }     else {         client_print(id, print_chat, "[AMXX] You have been respawned.")         console_print(id, "[AMXX] You have been respawned.")     }     return PLUGIN_HANDLED } public finishRespawn() {     spawn(g_respawnIndex[g_respawnCount])     g_respawnIndex[g_respawnCount] = false     g_respawnCount--     return PLUGIN_HANDLED }
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 03-19-2005 , 03:27  
Reply With Quote #4

Is your name whitemike?
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 03-19-2005 , 16:14  
Reply With Quote #6

Thats an awsome idea. I'd use it if i played cs.
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
KaOs
Senior Member
Join Date: Apr 2004
Old 03-19-2005 , 17:30  
Reply With Quote #7

Doesn't have to be CS I don't think.. cstrike module isnt required at least
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-19-2005 , 19:54   hmm
Reply With Quote #8

use spawn(id)
spawn(id)

Theres a bug with it I believe
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
KaOs
Senior Member
Join Date: Apr 2004
Old 03-21-2005 , 17:35  
Reply With Quote #9

that's what i'm using isn't it?
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-21-2005 , 21:40  
Reply With Quote #10

Yea, but he means use it twice just after each other like:
spawn(id)
spawn(id)

It prevents some glitches, mainly with hud I think.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
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 13:26.


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