Raised This Month: $ Target: $400
 0% 

Spawn client [FM]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-11-2013 , 01:19   Spawn client [FM]
Reply With Quote #1

Hello!

This simple code not works correctly:
PHP Code:
public plugin_init()
{
set_task(15.0"simple_spawn"3423354)
}

public 
simple_spawn()
{
    
    new 
players[32], inum
    get_players
(playersinum"h")
        
    for (new 
0inum; ++i)
    {
            if(
cs_get_user_team(players[i]) == CS_TEAM_CT || CS_TEAM_CT)
            {
            
dllfunc(DLLFunc_Spawni)
            }
    }
    
remove_task(3423354)

_____________________________________________ _________________________
And with this version i have an errors in server's console:
PHP Code:
public plugin_init()
{
set_task(15.0"simple_spawn"3423354)
}

public 
simple_spawn(id)
{
            
dllfunc(DLLFunc_Spawnid)
            
remove_task(3423354)

Code:
L 01/11/2013 - 10:17:04: [FAKEMETA] Invalid entity
L 01/11/2013 - 10:17:04: [AMXX] Run time error 10 (plugin "test.amxx") (native "dllfunc") - debug not enabled!
L 01/11/2013 - 10:17:04: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
_____________________________________________ _________________________
In this ver. all works fine. Paradox..

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say ss""ssfc")
    
// Add your code here...
}

public 
ssfc(id) {
    
dllfunc(DLLFunc_Spawnid)

How i can execute function DDLFuncf_Spawn for all players ?
__________________
sorry my bad english...

Last edited by alonelive; 01-11-2013 at 02:03.
alonelive is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-11-2013 , 02:44   Re: Spawn client [FM]
Reply With Quote #2

Why not use HAM?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-11-2013 , 02:50   Re: Spawn client [FM]
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
Why not use HAM?
Players spawn without death (simple return to team spawn place). Players' weapons must remain.
I use this code for some effects.
Can you help me with topic's question?

It's hard to explain it in English. In Russian, I would be happy to explain)
__________________
sorry my bad english...

Last edited by alonelive; 01-11-2013 at 02:52.
alonelive is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-11-2013 , 11:17   Re: Spawn client [FM]
Reply With Quote #4

plugin_init is too early to call this.... What exactly are you trying to do? Why can you not use Ham_CS_RoundRespawn?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-12-2013 , 08:34   Re: Spawn client [FM]
Reply With Quote #5

not preffer to set task in init..

PHP Code:
public plugin_init()
{
set_task(15.0"simple_spawn"3423354)
}

public 
simple_spawn()
{
    
    new 
players[32], inum
    get_players
(playersinum"h")
        
    for (new 
0inum; ++i)
    {
            if((
cs_get_user_team(players[i]) == CS_TEAM_CT) || (cs_get_user_team(players[i])==CS_TEAM_T)) 
            {
           
// dllfunc(DLLFunc_Spawn, players[i]) // dont use this: https://forums.alliedmods.net/showpost.php?p=1872093&postcount=8
              
ExecuteHamBHam_CS_RoundRespawnplayers[i] );
            }
    }

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-12-2013 at 10:50.
AngeIII is offline
Send a message via Skype™ to AngeIII
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-12-2013 , 08:37   Re: Spawn client [FM]
Reply With Quote #6

Quote:
Originally Posted by AngeIII View Post
not preffer to set task in init..

PHP Code:
public plugin_init()
{
set_task(15.0"simple_spawn"3423354)
}

public 
simple_spawn()
{
    
    new 
players[32], inum
    get_players
(playersinum"h")
        
    for (new 
0inum; ++i)
    {
            if(
cs_get_user_team(players[i]) == CS_TEAM_CT || CS_TEAM_CT)
            {
            
dllfunc(DLLFunc_Spawnplayers[i])
            }
    }

if(cs_get_user_team(players[i]) == CS_TEAM_CT || CS_TEAM_CT)
how useless is this?
if (true) will do the same thing lol
jimaway is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-12-2013 , 08:43   Re: Spawn client [FM]
Reply With Quote #7

heh yeah.
if((cs_get_user_team(players[i]) == CS_TEAM_CT) || (cs_get_user_team(players[i])==CS_TEAM_T))
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2013 , 09:04   Re: Spawn client [FM]
Reply With Quote #8

DLLFunc_Spawn is not intended to respawn a player, only to spawn entities.
For players, use MUST use ham, use RoundRespawn.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-12-2013 at 09:04.
ConnorMcLeod is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-12-2013 , 10:48   Re: Spawn client [FM]
Reply With Quote #9

Thank you all! AngeIII's version works fine!
__________________
sorry my bad english...
alonelive is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-12-2013 , 10:49   Re: Spawn client [FM]
Reply With Quote #10

use this :
ExecuteHamB( Ham_CS_RoundRespawn, players[i] );
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
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 13:47.


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