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

[D7] Spawn at last place v0.4.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay       
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-22-2015 , 13:53   [D7] Spawn at last place v0.4.2
Reply With Quote #1

D i 5 7 i n c T's Spawn at last place




Allows players to (re)spawn at the last place they were and with the exact view angles they had on certain events like spawn, death, round start, round end, game commence, game restart.

Works flawlessly even in crouch zones and doesn't get you stuck or clip your view through objects.

Runs on any GoldSource(Half-Life 1) engine game.

Supports Counter-Strike: Condition Zero bots.




CVar: D7SALPSettings

Add the following letters to the CVar value in order to define the plug-in's actions on the position(s) and view angles of the player(s):
a - Save on round start
b - Save on round end
c - Save on game commence
d - Save on game restart
e - Save on player spawn
f - Save on player death
g - Reset on round start
h - Reset on round end
i - Reset on game commence
j - Reset on game restart
k - Reset on player spawn
l - Reset on player death

Default value: bcdf
If both reset and save of the same event are set, only the reset will trigger.
Set the CVar tot blank("") or 0 in order to disable. This will NOT delete previously saved player information such as origin and view angles.




None.




This plug-in requires the following:
- Ham Bots API. Latest version as of today(2015 December 22) of the script(cs_ham_bots_api.sma) and include(cs_ham_bots_api.inc) are attached along below.
- BitSum stocks include file (bitsums.inc). Attached along below.

Get source and compile locally.

Use along with an unstuck plug-in, just in case you get teleported inside an entity that is moving and intersecting with your saved spot.



ConnorMcLeod - For his "force duck" code.
SonicSonedit - For his game commence and restart hooks. (Yes, I still don't know how to use register_event. Shame on me.)
MeRcyLeZZ - For his HamSandwich register bots API and preventing multiple end round triggers code from Zombie Plague Mod.
dorin2oo7 - For his images I used to style up my post.
NiHiLaNTh, schmurgel1983, KliPPy, meTaLiCroSS - For being true friends and always helping and teaching me new stuff.
The Professional - For requesting this(sort of).




Code:
* To do

T = needs testing
X = done
- = cancelled

[ ] Make the teleported player able to pass through any entity for a certain amount of time or until he's not coliding with anything anymore to fully avoid getting stuck
[ ] add support for custom player sizes
[ ] add support for custom player view offsets

* v0.4.2 (2016 August 21)
[X] fix vertical angle not setting at the exact position of save(note it seems to be correcting until reaching the middle)
[X] fix first person camera clipping through solids when teleporting in very tight spaces
[T] add ability to save and reset on player spawn
[X] letters instead of numbers for the settings bitsum(Suggested by KliPPy)
[X] fix vertical angle of player model jumping when set

* v0.3.7 (2016 August 13)
[X] fix wrong vertical min and max for crouching once again(-25 -> -18, 25 -> 32)
[X] make last time round ended a local function static instead of a new global since we only use it there
[X] make a simple global variable for round ended instead of calculating time between the last round ends to further prevent multiple round ends triggering
[-] localize maxplayers variable inside ftInfoSavePlayer since it's only used there?
[X] fix position not saving on death

* v0.3.3 (2016 August 10)
[X] don't alter the player origin information on reset
[X] bitsum variable for player IDs that should be moved on spawn
[X] check for cvar != 0 on spawn before moving the player
[X] correct player model entity crouch vertical mins and maxs(18 -> 25 since 50 is the player vertical size when crouching and not 36)
[X] move the mins and maxs constants inside the function since it's the only place where they're being used
[-] reset players info on spawn if bitsum cvar is 0 so that the cvar check won't happen for the other players too
[-] reset players info on events if bitsum cvar is 0
[X] make iID constant in ftInfoResetPlayer since we don't use the loop hence won't change it anymore
[X] fix potential bug where individual player info could be saved if not alive

* v0.2.5 (2015 December 22)
- First release
[X] separate bits for death, commence, restart, end reset and save
[X] fix round end save being triggered on game commencing
[X] optimize
[X] add support for CZ bots (optional)
[X] cache player alive status



Attached Files
File Type: sma Get Plugin or Get Source (cs_ham_bots_api.sma - 878 views - 7.3 KB)
File Type: inc cs_ham_bots_api.inc (1.4 KB, 431 views)
File Type: inc bitsums.inc (386 Bytes, 737 views)
File Type: sma Get Plugin or Get Source (D7SpawnAtLastPlace.sma - 883 views - 11.8 KB)
__________________

Last edited by georgik57; 03-05-2020 at 10:22. Reason: Re-organized post
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-24-2015 , 08:00   Re: [D7] Spawn at last place v0.2.5
Reply With Quote #2

That bitsums include is unnecessary.
PartialCloning is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-26-2015 , 12:52   Re: [D7] Spawn at last place v0.2.5
Reply With Quote #3

Quote:
Originally Posted by PartialCloning View Post
That bitsums include is unnecessary.
Not really. I use that code in a lot of plug-ins and it's easier to include rather than to copy and paste it every time.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 12-26-2015 , 17:36   Re: [D7] Spawn at last place v0.2.5
Reply With Quote #4

Quote:
Originally Posted by georgik57 View Post
Not really. I use that code in a lot of plug-ins and it's easier to include rather than to copy and paste it every time.
if it can be included into the plugin file would be better so users can just use the Get-Plugin link.
__________________
Blizzard_87 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-27-2015 , 03:47   Re: [D7] Spawn at last place v0.2.5
Reply With Quote #5

Quote:
Originally Posted by Blizzard_87 View Post
if it can be included into the plugin file would be better so users can just use the Get-Plugin link.
It's best to download and compile locally with your server's version of AmxModX anyway.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Old 08-09-2016, 23:09
georgik57
This message has been deleted by georgik57.
Old 08-13-2016, 10:49
georgik57
This message has been deleted by georgik57.
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 08-21-2016 , 12:44   Re: [D7] Spawn at last place v0.4.2
Reply With Quote #6

Quote:
Originally Posted by georgik57 View Post
Updated. Check the first post for more information.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 04-03-2021 , 21:30   Re: [D7] Spawn at last place v0.4.2
Reply With Quote #7

Is there any way to make it possible to only revive nearby players?
Ark_Procession is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-04-2021 , 07:01   Re: [D7] Spawn at last place v0.4.2
Reply With Quote #8

Quote:
Originally Posted by Ark_Procession View Post
Is there any way to make it possible to only revive nearby players?
This plugin doesn't respawn players. It only changes their spawn origin.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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 09:47.


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