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

[D7] Spawn at last place v0.4.2


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 - 890 views - 7.3 KB)
File Type: inc cs_ham_bots_api.inc (1.4 KB, 437 views)
File Type: inc bitsums.inc (386 Bytes, 755 views)
File Type: sma Get Plugin or Get Source (D7SpawnAtLastPlace.sma - 886 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
 



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 03:20.


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