Raised This Month: $12 Target: $400
 3% 

Potti Bot Doesn't Respawn Where He Died


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
enjoi.
Veteran Member
Join Date: Mar 2011
Old 07-26-2014 , 05:48   Potti Bot Doesn't Respawn Where He Died
Reply With Quote #1

Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

new gSetSpawnOrigin;
#define ShouldSetSpawnOrigin(%1) (gSetSpawnOrigin &   (1 << (%1 & 31)))
#define SetSpawnOrigin(%1)        gSetSpawnOrigin |=  (1 << (%1 & 31))
#define ClearSpawnOrigin(%1)      gSetSpawnOrigin &= ~(1 << (%1 & 31))

#define MAX_PLAYERS 32

new Float:gSpawnOrigin[MAX_PLAYERS + 1][3];

public plugin_init() {
    register_plugin("Respawn Position", "0.0.1", "Exolent");
    
    RegisterHam(Ham_Killed, "player", "FwdPlayerKilled");
    RegisterHam(Ham_Killed, "player", "FwdPlayerKilledPost", 1);
    RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawnPost", 1);
}

public client_disconnect(id) {
    ClearSpawnOrigin(id);
}

public FwdPlayerKilled(victim, killer, shouldGib) {
    entity_get_vector(victim, EV_VEC_origin, gSpawnOrigin[victim]);
    SetSpawnOrigin(victim);
}

public FwdPlayerKilledPost(victim, killer, shouldGib) {
    entity_set_int(victim, EV_INT_deadflag, DEAD_RESPAWNABLE);
    entity_set_float(victim, EV_FL_nextthink, get_gametime());
}

public FwdPlayerSpawnPost(id) {
    if(ShouldSetSpawnOrigin(id) && is_user_alive(id)) {
        entity_set_vector(id, EV_VEC_origin, gSpawnOrigin[id]);
        
        ClearSpawnOrigin(id);
    }
}
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 07-26-2014 , 06:08   Re: Potti Bot Doesn't Respawn Where He Died
Reply With Quote #2

For respawn Potti, better to edit source (SMA) file of Potti plugin.
PHP Code:
ExecuteHamB(Ham_CS_RoundRespawnid
Phant is offline
Send a message via ICQ to Phant
enjoi.
Veteran Member
Join Date: Mar 2011
Old 07-26-2014 , 06:13   Re: Potti Bot Doesn't Respawn Where He Died
Reply With Quote #3

Quote:
Originally Posted by Phant View Post
For respawn Potti, better to edit source (SMA) file of Potti plugin.
PHP Code:
ExecuteHamB(Ham_CS_RoundRespawnid
Tell you the truth, i don't know where to add that, i am a noob at coding.
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
Reply


Thread Tools
Display Modes

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 11:42.


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