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

new respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-08-2018 , 12:02   new respawn
Reply With Quote #1

since I tried this plugin with respawn related plugins and founded that the players whom killed by the bomb doesn't respawn I coded this respawner to solve the problem.
Attached Files
File Type: sma Get Plugin or Get Source (respawn.sma - 1055 views - 639 Bytes)
__________________
man_s_our is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-08-2018 , 12:38   Re: new respawn
Reply With Quote #2

This code has more problems than lines of code.
__________________

Last edited by HamletEagle; 03-08-2018 at 12:38.
HamletEagle is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 03-09-2018 , 05:14   Re: new respawn
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
This code has more problems than lines of code.
like what?
__________________
man_s_our is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-09-2018 , 08:53   Re: new respawn
Reply With Quote #4

Quote:
Originally Posted by man_s_our View Post
like what?
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?
__________________

Last edited by HamletEagle; 03-09-2018 at 08:59.
HamletEagle is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-09-2018 , 12:03   Re: new respawn
Reply With Quote #5

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?
Why you told him all this if you can tell him as dexter show you in example
Also him code is stolen from the code that i showed you and i think this idea is already unnaproved D:
__________________

Last edited by D3XT3R; 03-09-2018 at 12:04.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-09-2018 , 12:41   Re: new respawn
Reply With Quote #6

Quote:
Originally Posted by D3XT3R View Post
Why you told him all this if you can tell him as dexter show you in example
Why are you talking to yourself in third person?

The code is terrible. If you want to fix a broken plugin, you usually do it by making a better version, not this.
__________________

Last edited by OciXCrom; 03-09-2018 at 13:45.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 #8

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
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-09-2018 , 07:54   Re: new respawn
Reply With Quote #9

Quote:
Originally Posted by man_s_our View Post
since I tried this plugin with respawn related plugins and founded that the players whom killed by the bomb doesn't respawn I coded this respawner to solve the problem.
https://forums.alliedmods.net/showthread.php?p=8906
__________________

Last edited by D3XT3R; 03-09-2018 at 07:54.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 03-09-2018 , 08:01   Re: new respawn
Reply With Quote #10

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 ) }
__________________

Last edited by D3XT3R; 03-09-2018 at 08:02.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Reply



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 15:18.


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