AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   No worldspawn (https://forums.alliedmods.net/showthread.php?t=49300)

TehCaesar 12-31-2006 20:35

No worldspawn
 
Is it possible with a plugin to remove the problem with players dieing at the start of the round because of not enough respawn points?

If not I would appreciate it if you could do a plugin that respawns a player if they die within 5 seconds of a round.

Thanks in advance.

Silencer123 12-31-2006 20:44

Re: No worldspawn
 
If you have a question on something that could be solved with a function,
then the first you should do is to search in the AMXModX FuncWiki. Only
if you really find nothing you may ask here. That would help you to prevent
that much negative Karma and in this case it would result in this:
http://www.amxmodx.org/funcwiki.php?go=func&id=837
If you now say that it will not work then that is probably because you did
not say for what modification you want to write your plugin. But as you make
a really mindless impression on me I guess that it shall be for Counter-Strike.
However, keep this in mind: http://www.amxmodx.org/funcwiki.php
So if you now want to know how to make that delay of 5 seconds, think
of what could that be called in the english language. It is possible that you
have to try some words and read through some stuff before you reach the
function which you need, but after some tries you enter "task":
http://www.amxmodx.org/funcwiki.php?...task&go=search
And you read: "set_task". Now that sounds really encouraging, doesn't it?
And then you click it and read an wooooooooooooooooooosh:
http://www.amxmodx.org/funcwiki.php?go=func&id=253
It is what you want, isn't it? And after some more research you arrive at this point:
Code:
#include <amxmodx> #include <cstrike> public plugin_init() {     register_plugin("Revive","1.0","TheGreatAuthor")     register_event("DeathMsg", "hook_death", "a") } public hook_death() {     new Dead_Guys_ID=read_data(2)     set_task(5.0,"revive_him",Dead_Guys_ID) } public revive_him(Dead_Guys_ID) {     cs_user_spawn(Dead_Guys_ID) }
So simple, isn't it?

stupok 12-31-2006 21:17

Re: No worldspawn
 
But it's wrong. :shock: That will revive the user 5.0 seconds after dying.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Revive if Killed in 5 Seconds" #define VERSION "1.0" #define AUTHOR "stupok69" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_logevent("logevent_round_start", 2, "1=Round_Start") } public logevent_round_start() {     set_task(5.0, "revive_function") } public revive_function() {     new players[32], num         get_players(players, num, "bh")         for(new i = 0; i < num; i++)         cs_user_spawn(i) }

TehCaesar 12-31-2006 21:22

Re: No worldspawn
 
Quote:

Originally Posted by Silencer123 (Post 422346)
If you have a question on something that could be solved with a function,
then the first you should do is to search in the AMXModX FuncWiki. Only
if you really find nothing you may ask here. That would help you to prevent
that much negative Karma and in this case it would result in this:

The reason I have such negative karma is because I ask for it. Why would I care about Karma?

And I can't code worth shit so searching the functions on how to set a time for the respawn wouldn't work because I don't know how to apply it.

SweatyBanana 12-31-2006 21:25

Re: No worldspawn
 
Quote:

Originally Posted by stupok69 (Post 422353)
But it's wrong. :shock: That will revive the user 5.0 seconds after dying.

That still wont work.. You can use a bool and set it to false five seconds after round start, then check when a player dies if the bool is true or not, then revive (or not).

stupok 12-31-2006 21:28

Re: No worldspawn
 
The quoted code you posted is all jarbled up on my screen. Anyways, why wouldn't it work? Be specific. I don't see the need for any booleans.

SweatyBanana 12-31-2006 21:31

Re: No worldspawn
 
You didnt even call a client_death function...

stupok 12-31-2006 21:38

Re: No worldspawn
 
I register the round start, wait 5 seconds, and revive any dead clients. Why would you need client_death?

SweatyBanana 12-31-2006 22:30

Re: No worldspawn
 
Mah bad.. Didnt see the flags there.

Imanoobie 01-01-2007 07:51

Re: No worldspawn
 
Quote:

Originally Posted by stupok69 (Post 422353)
But it's wrong. :shock: That will revive the user 5.0 seconds after dying.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Revive if Killed in 5 Seconds" #define VERSION "1.0" #define AUTHOR "stupok69" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_logevent("logevent_round_start", 2, "1=Round_Start") } public logevent_round_start() {     set_task(5.0, "revive_function") } public revive_function() {     new players[32], num         get_players(players, num, "bh")         for(new i = 0; i < num; i++)         cs_user_spawn(i) }

This sure works but...what if the player TKed the round before?
Then he will get no punishment o_O


All times are GMT -4. The time now is 22:28.

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