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

new respawn


Post New Thread Reply   
 
Thread Tools Display Modes
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-09-2018 , 20:02   Re: new respawn
Reply With Quote #11

Quote:
Originally Posted by D3XT3R View Post
can be done with better ways
Code:
#include < amxmodx > #include < amxmisc > #include < hamsandwich > public plugin_init( ) {     RegisterHam( Ham_Killed, "player", "Ham_PlayerDeath", 1 ) } public Ham_PlayerDeath( victim, attacker, shouldgib ) {     set_task( 1.0, "respawn", victim ) } public respawn( victim ) {     if( is_user_alive( victim ) )         return         ExecuteHamB( Ham_CS_RoundRespawn, victim ) }
does the code worked with that plugin?
because it doesn't record c4's victims as I observed.

edit:
tested it and it works.
thanks.

2nd edit:
it respawns only human players not bots.
__________________

Last edited by man_s_our; 03-10-2018 at 09:47.
man_s_our is offline
Old 03-09-2018, 20:10
man_s_our
This message has been deleted by man_s_our. Reason: missunderstanding the quoted reply
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-09-2018 , 20:35   Re: new respawn
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
1.You are using permanent tasks to respawn the player where you could simply hook Ham_Killed.
2.The way you get all players(loop with get_maxplayers) is wrong. In most cases you should use get_players.
3.Declaring variables in a loop.
4.If I remember right using spawn() on players has issues, but I don't feel like checking right now. Anyway, you should use Ham for this.
5.Creating different tasks with the same id.
6.Why are you using 2 tasks at 0.5 and at 0.7 seconds to respawn the player?
7.Why include cstrike if you are not going to use it?
either I didn't see Ham_killed tutorial or it was used in other respawn plugins and didn't work with the c4.
this is the first time I know about get_players(). after all I'm amature in amxx coding.
I declared the index in the loop starting only. if you mean somewhere else then I forgetted about.
when I searched for the set_task tutorials I didn't find the identification for the id but I found that setting the same id for two tasks (at least if they aren't different) doesn't effect.
__________________
man_s_our is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-10-2018 , 16:24   Re: new respawn
Reply With Quote #13

Ham_Killed will work for everything, the function behind it is responsible for killing a player.

Quote:
it respawns only human players not bots.
What bots are you using?
__________________

Last edited by HamletEagle; 03-10-2018 at 16:25.
HamletEagle is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-11-2018 , 01:36   Re: new respawn
Reply With Quote #14

Try use podbots are like real players
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-11-2018 , 15:47   Re: new respawn
Reply With Quote #15

Quote:
Originally Posted by HamletEagle View Post
Ham_Killed will work for everything, the function behind it is responsible for killing a player.


What bots are you using?
the original ones
__________________
man_s_our is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-11-2018 , 16:15   Re: new respawn
Reply With Quote #16

You many need to use a trick. When a bot connects, from putinserver set a 0.1 seconds task. Then do RegisterHamFromEntity(Ham_Spawn, bot_id, "function", true). For certain bots you need this workaround.
__________________

Last edited by HamletEagle; 03-11-2018 at 16:15.
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-19-2018 , 09:42   Re: new respawn
Reply With Quote #17

Unapproved for obvious reasons.
__________________
HamletEagle 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 08:50.


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