AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   can be linked with hamspawn putinserver?? (https://forums.alliedmods.net/showthread.php?t=251595)

niko1921 11-15-2014 19:08

can be linked with hamspawn putinserver??
 
can be linked with hamspawn putinserver??

This would not want to make the plugin:

I correct errors that do not know how to adapt to ham_pawn public putinserver unopened another public or whatever works in one .. because if you would follow sepearo working separately ...



PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "auto restart round knife"
#define VERSION "test1"
#define AUTHOR "KramerEditor"


new g_players
new boolg_usado // it acts just 1 time ..



public plugin_init () {
         
register_plugin ("PLUGIN""VERSION""AUTHOR")
         
RegisterHam (Ham_Spawn"player""ham_spawn"1);
        
g_players get_maxplayers ()
}
        public 
client_putinserver (id// I want no change .. I just want to occur when connecting to the server .. ..
{
        if (! 
g_usado// act 1 time - HOME
        
if (get_playersnum ()> = 2)
         {
         
server_cmd ("sv_restartround 1"// restart the round to detect more than 2 players ..
}
ham_spawn () // it acts like one once you pass the restartround and it acts no more .. or is that long after the restartround weapons. and never                  until change the map .. ie after I draw weapons that can grab back the weapons .. (only 1 time as aga in the first spawn)
{
        
strip_user_weapons (id// We take out the weapons ...
        
give_item (id"weapon_knife"// You give the knife
         
}
         
g_usado true // act 1 time up here - (vedadero)
         
}
         return 
PLUGIN_HANDLED


tranks!! :D

fysiks 11-15-2014 19:12

Re: can be linked with hamspawn putinserver??
 
"put in server" and "ham_spawn" are not related.

What are you wanting the plugin to do? Explain in detail without using any references to the code.

niko1921 11-15-2014 19:31

Re: can be linked with hamspawn putinserver??
 
the purpose of the plugin was to detect more than 1 player on the server restart the round and strip the weapons of the players .. but once..
until the map is changed..

so it is;
new bool: g_usado

help!!me
sorry my english

avril-lavigne 11-16-2014 02:46

Re: can be linked with hamspawn putinserver??
 
strip weapons for all players at spawn one time ?

try offset

PHP Code:


RegisterHam
(Ham_Spawn"player""sp",1)
const 
m_iSpawnCount 365;



public 
sp(id)
{
   if(
get_pdata_int(idm_iSpawnCount,) == 1)
   {
     
strip_user_weapons(id)    
     
server_print("spawn times %d"get_pdata_int(idm_iSpawnCount,) )
   }


offset auto set to 1 when round restarts

simanovich 11-17-2014 02:01

Re: can be linked with hamspawn putinserver??
 
Quote:

Originally Posted by fysiks (Post 2224690)
"put in server" and "ham_spawn" are not related.

What are you wanting the plugin to do? Explain in detail without using any references to the code.

For some reason, Ham_Spawn is called when client is "put in server" (then is_user_alive will return false)

YamiKaitou 11-17-2014 07:41

Re: can be linked with hamspawn putinserver??
 
Quote:

Originally Posted by simanovich (Post 2225231)
For some reason, Ham_Spawn is called when client is "put in server" (then is_user_alive will return false)

It is called because the Player Entity is being created. It is not a reliable substitution for client_putinserver though.

fysiks 11-17-2014 19:28

Re: can be linked with hamspawn putinserver??
 
I thought it was always before client_putinserver(). But regardless, Ham_Spawn should not be used to detect putinserver as Yami said.


All times are GMT -4. The time now is 17:31.

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