Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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


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