Raised This Month: $ Target: $400
 0% 

Some plugins do not work on my hosted server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jievylook
Senior Member
Join Date: Sep 2018
Old 04-01-2019 , 18:22   Some plugins do not work on my hosted server
Reply With Quote #1

Hi all.
A server of ZP cs 1.6 was created -

Before hosting all the plugins worked correctly and when I created a game on my PC everything was great.

Now when I've hosted mi server some plugins stopped working.
For example, a simple add-on like the following that makes all rounds begin with a knife.

PHP Code:
#include <amxmodx>   
#include <fun>   
#include <cstrike>   
#include <hamsandwich>   

#define PLUGIN ""  
#define VERSION ""  
#define AUTHOR ""  

public plugin_init( )   
{   
    
register_plugin(PLUGINVERSIONAUTHOR)  
    
RegisterHamHam_Spawn"player""fw_PlayerSpawn" )   
}   

public 
fw_PlayerSpawnid )   
{   
        
strip_user_weaponsid )   
        
give_itemid"weapon_knife" )   


I need help and I do not know where to look.
jievylook is offline
Old 04-02-2019, 07:47
raizo11
This message has been deleted by raizo11.
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-02-2019 , 09:09   Re: Some plugins do not work on my hosted server
Reply With Quote #2

PHP Code:
#include <amxmodx>   
#include <fun>   
#include <cstrike>   
#include <hamsandwich>   

#define PLUGIN ""  
#define VERSION ""  
#define AUTHOR ""  

public plugin_init( )   
{   
       
register_plugin(PLUGINVERSIONAUTHOR)  
        
RegisterHamHam_Spawn"player""fw_PlayerSpawn"1)   // post spawn
}   

public 
fw_PlayerSpawnid )   
{   
    if(!
is_user_alive(id))
        return 
HAM_IGNORED

        strip_user_weapons
id )   
        
give_itemid"weapon_knife" )  
        return 
HAM_IGNORED // make compiler happy

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 04-02-2019 at 16:25.
iceeedr is offline
Send a message via Skype™ to iceeedr
eat1k
Senior Member
Join Date: Apr 2018
Old 04-02-2019 , 09:27   Re: Some plugins do not work on my hosted server
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

#pragma semicolon 1

new const PLUGIN_VERSION[] = "1.0";

public 
plugin_init()    
{    
    
register_plugin("PLUGIN"PLUGIN_VERSION"AUTHOR");
    
RegisterHam(Ham_Spawn"player""fmfwd_PlayerSpawn_Post"true);
}    

public 
fmfwd_PlayerSpawn_Post(id)    
{    
    if(!
is_user_alive(id)) 
        return 
HAM_IGNORED

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");

    return 
HAM_IGNORED

__________________

Last edited by eat1k; 04-02-2019 at 09:27.
eat1k is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-02-2019 , 09:35   Re: Some plugins do not work on my hosted server
Reply With Quote #4

I wonder why do you guys posted same code 3 times...
Return values are ignored in post forwards.
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-02-2019 , 09:41   Re: Some plugins do not work on my hosted server
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
I wonder why do you guys posted same code 3 times...
Return values are ignored in post forwards.
I completely forgot the detail of the return values ​​being ignored in post forwards, but I posted the code just because you do not need set_task for the procedure.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-02-2019 , 09:48   Re: Some plugins do not work on my hosted server
Reply With Quote #6

Yes indeed, raizo's code does not make any sense, but eat1k's code it's the same, except for "true" instead of "1" and "fmfwd_PlayerSpawn_Post" instead of "fw_PlayerSpawn". To be honest I didn't notice any improvement in that.
__________________









Last edited by CrazY.; 04-02-2019 at 09:48.
CrazY. is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-02-2019 , 12:02   Re: Some plugins do not work on my hosted server
Reply With Quote #7

You're using the Ham_Spawn as Pre forward, so the user is still dead, that's why when he ACTUALLY spawn, it doesn't strip his weapons, since it tried when he was dead, and the native does not work with dead players.

So the #2 reply adds a task that's executed when the player is alive, basically the same as the #3 reply.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-02-2019 at 12:04.
EFFx is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-02-2019 , 13:35   Re: Some plugins do not work on my hosted server
Reply With Quote #8

Quote:
Originally Posted by CrazY. View Post
I wonder why do you guys posted same code 3 times...
Return values are ignored in post forwards.
You must know about "func must return a value" warning.
PHP Code:
public fmfwd_PlayerSpawn_Post(id)    
{    
    if(!
is_user_alive(id)) 
        return 
HAM_IGNORED// because of this

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");

    return 
HAM_IGNORED// you must put this

Some sort of a solution:
PHP Code:
public fmfwd_PlayerSpawn_Post(id)    
{    
    if(!
is_user_alive(id)) 
        return; 
// you don't return a value, but tehnically it is 'return 0' anyway

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");

__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-02-2019 , 13:58   Re: Some plugins do not work on my hosted server
Reply With Quote #9

I didn't understand what you mean. I did refer to any return value and not only the "last one".
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-02-2019 , 14:07   Re: Some plugins do not work on my hosted server
Reply With Quote #10

Crazy, what you're saying is that it's not necessary to check if the player is alive? Because by checking, you need to give the value to return (to ignore) and this causes the need to make the compiler of amxx happy, because of the warning that it is giving.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 07:42.


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