AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Works on win but not on linux? (https://forums.alliedmods.net/showthread.php?t=126450)

KadiR 05-09-2010 11:44

Works on win but not on linux?
 
This works perfectly on my Windows server, on the linux one not, i can't see the message. I uploaded everything fine, code:

PHP Code:

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event("DeathMsg""eDeath""a");
}

public 
eDeath()
{
    new 
killer read_data);
    new 
victim read_data);
    new 
weapon[8]
    
read_data(4weapon7
    
    new 
szNameK[32], szNameV[32];
    
get_user_name(killerszNameK31);
    
get_user_name(victimszNameV31);
    
    if (
killer != victim && equal(weapon"awp")) 
    {
    
client_print(0print_chat"%s killed someone with the AWP!"szNameK);
    }



hleV 05-09-2010 11:56

Re: Works on win but not on linux?
 
I don't see why it wouldn't work.
You may want to try the optimized version:
PHP Code:

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR); 
 
    
register_event("DeathMsg""eDeath""a""1>0"); 

 
public 
eDeath() 

    new 
killer read_data); 
 
    if (
killer == read_data(2))
        return;
 
    new 
weapon[5
    
read_data(4weapon4
 
    if (!
equal(weapon"awp"))
        return; 
 
    new 
szNameK[32]; 
    
get_user_name(killerszNameK31); 
 
    
client_print(0print_chat"%s killed someone with the AWP!"szNameK); 



KadiR 05-09-2010 15:12

Re: Works on win but not on linux?
 
Ok I updated it with your code. Still works only on WIN I reuploaded everything fine.

KadiR 05-26-2010 14:50

Re: Works on win but not on linux?
 
bump

Seta00 05-26-2010 19:52

Re: Works on win but not on linux?
 
Quote:

Originally Posted by hleV (Post 1175584)
PHP Code:

    if (!equal(weapon"awp")) 


Shouldn't weapon be "weapon_awp"?

Exolent[jNr] 05-26-2010 20:02

Re: Works on win but not on linux?
 
Quote:

Originally Posted by Seta00 (Post 1192196)
Shouldn't weapon be "weapon_awp"?

http://wiki.amxmodx.org/Half-Life_1_...vents#DeathMsg

KadiR 05-27-2010 15:15

Re: Works on win but not on linux?
 
As I said, it works perfect on windows, it prints that I killed someone with the AWP, but on my linux one.. not... :(


All times are GMT -4. The time now is 03:37.

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