Raised This Month: $ Target: $400
 0% 

Plugin compile error (old plugin)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 05-17-2016 , 11:40   Plugin compile error (old plugin)
Reply With Quote #1

Hello. Can anyone fix these errors?

PHP Code:
#include <amxmodx>
#include <dhudmessage>

#define PLUGIN "HUD MSG for VIP,Admin,Player"
#define VERSION "1.0"
#define AUTHOR "4iTGAME & Dim4ik"


public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
client_putinserver(id)set_task(5.0,"flappybuird",id)
public 
flappybuird(id)
{
    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
     
    if(
get_user_flags(id) & ADMIN_LEVEL_B)
    {
        
set_dhudmessage(025500.280.1606.012.0)
        
show_dhudmessage(id"Glad to see the Administrator %s! Enjoy the game."szName)
    }
    else if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
set_dhudmessage(025500.280.1606.012.0)
        
show_dhudmessage(id"Glad to see you VIP %s! Enjoy the game."szName)
    }
    else
    {
        
set_dhudmessage(025500.280.1606.012.0)
        
show_dhudmessage(id"Glad to see you %s ! Enjoy the game."szName)
    }
}
     
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
Attached Thumbnails
Click image for larger version

Name:	err.png
Views:	108
Size:	23.3 KB
ID:	154747  
Attached Files
File Type: inc dhudmessage.inc (3.4 KB, 110 views)
File Type: sma Get Plugin or Get Source (Greet_HUD.sma - 429 views - 1.1 KB)

Last edited by LithuanianJack; 05-17-2016 at 11:41.
LithuanianJack is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-17-2016 , 11:47   Re: Plugin compile error (old plugin)
Reply With Quote #2

It compiles fine without any errors for me.

Edit: What version of AMXX are you using to compile the plugin with?

Edit 2: If you're using AMXX 1.8.3 remove
PHP Code:
#include <dhudmessage> 
then the plugin should compile
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-17-2016 at 11:54.
wickedd is offline
Old 05-17-2016, 11:49
Black Rose
This message has been deleted by Black Rose. Reason: too slow
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 05-17-2016 , 12:19   Re: Plugin compile error (old plugin)
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
It compiles fine without any errors for me.

Edit: What version of AMXX are you using to compile the plugin with?

Edit 2: If you're using AMXX 1.8.3 remove
PHP Code:
#include <dhudmessage> 
then the plugin should compile
1.8.3. Thank you, it works when I removed #include <dhudmessage>
LithuanianJack is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-17-2016 , 12:24   Re: Plugin compile error (old plugin)
Reply With Quote #4

Use this one instead because you are not checking task on putinserver (+ added some optimizations and shortened the code ):
P.S. Replace mysound.wav with your sound name ....

PHP Code:
#include <amxmodx> 
#include <dhudmessage> 

#define PLUGIN "HUD MSG for VIP,Admin,Player" 
#define VERSION "1.0" 
#define AUTHOR "4iTGAME & Dim4ik" 

new const welcome_sound[] = "mysound.wav"

public plugin_precache()
{
    
register_plugin(PLUGINVERSIONAUTHOR
    
precache_sound(welcome_sound)
}

public 
client_putinserver(id){ 
    if(
task_exists(id)) 
        
remove_task(id)
    
set_task(5.0,"flappybuird",id
}

public 
flappybuird(id){ 
    new 
szName[32],iflags
    
get_user_name(idszNamecharsmax(szName)) 
    
iflags get_user_flags(id);
    
set_dhudmessage(025500.280.1606.012.0)         
    
show_dhudmessage(id"Glad to see you %s%s ! Enjoy the game.", (iflags ADMIN_LEVEL_B) ? "Administrator " : (iflags ADMIN_LEVEL_H) ? "VIP " "" ,szName
    
client_cmd(id"spk %s"welcome_sound)


Last edited by siriusmd99; 05-17-2016 at 12:42.
siriusmd99 is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 05-17-2016 , 13:30   Re: Plugin compile error (old plugin)
Reply With Quote #5

Quote:
Originally Posted by siriusmd99 View Post
Use this one instead because you are not checking task on putinserver (+ added some optimizations and shortened the code ):
P.S. Replace mysound.wav with your sound name ....

PHP Code:
#include <amxmodx> 
#include <dhudmessage> 

#define PLUGIN "HUD MSG for VIP,Admin,Player" 
#define VERSION "1.0" 
#define AUTHOR "4iTGAME & Dim4ik" 

new const welcome_sound[] = "mysound.wav"

public plugin_precache()
{
    
register_plugin(PLUGINVERSIONAUTHOR
    
precache_sound(welcome_sound)
}

public 
client_putinserver(id){ 
    if(
task_exists(id)) 
        
remove_task(id)
    
set_task(5.0,"flappybuird",id
}

public 
flappybuird(id){ 
    new 
szName[32],iflags
    
get_user_name(idszNamecharsmax(szName)) 
    
iflags get_user_flags(id);
    
set_dhudmessage(025500.280.1606.012.0)         
    
show_dhudmessage(id"Glad to see you %s%s ! Enjoy the game.", (iflags ADMIN_LEVEL_B) ? "Administrator " : (iflags ADMIN_LEVEL_H) ? "VIP " "" ,szName
    
client_cmd(id"spk %s"welcome_sound)

That's okay, but i didn't hear the sound...
PHP Code:
new const welcome_sound[] = "myproject/mysound.wav" 
The sound location is: cstrike/sound/myproject/mysound.wav
LithuanianJack is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-17-2016 , 13:58   Re: Plugin compile error (old plugin)
Reply With Quote #6

PHP Code:
#include <amxmodx>  

#define PLUGIN "HUD MSG for VIP,Admin,Player" 
#define VERSION "1.0" 
#define AUTHOR "4iTGAME & Dim4ik" 

new const joining[] = "myproject/mysound.wav" 

public plugin_init(){ 
    
register_plugin(PLUGINVERSIONAUTHOR


public 
plugin_precache()
{
    
precache_soundjoining )  
}

public 
client_putinserver(id)set_task(5.0,"flappybuird",id
public 
flappybuird(id

    new 
szName[32
    
get_user_name(idszNamecharsmax(szName)) 
      
    if(
get_user_flags(id) & ADMIN_LEVEL_B
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see the Administrator %s! Enjoy the game."szName
        
client_cmdid"spk ^"sound/%s^""joining // copy and paste this line where you want the sound to play
    

    else if(
get_user_flags(id) & ADMIN_LEVEL_H
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see you VIP %s! Enjoy the game."szName
    } 
    else 
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see you %s ! Enjoy the game."szName
    } 

      
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } 
*/ 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-17-2016 at 14:08.
wickedd is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 05-18-2016 , 00:18   Re: Plugin compile error (old plugin)
Reply With Quote #7

Quote:
Originally Posted by wickedd View Post
PHP Code:
#include <amxmodx>  

#define PLUGIN "HUD MSG for VIP,Admin,Player" 
#define VERSION "1.0" 
#define AUTHOR "4iTGAME & Dim4ik" 

new const joining[] = "myproject/mysound.wav" 

public plugin_init(){ 
    
register_plugin(PLUGINVERSIONAUTHOR


public 
plugin_precache()
{
    
precache_soundjoining )  
}

public 
client_putinserver(id)set_task(5.0,"flappybuird",id
public 
flappybuird(id

    new 
szName[32
    
get_user_name(idszNamecharsmax(szName)) 
      
    if(
get_user_flags(id) & ADMIN_LEVEL_B
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see the Administrator %s! Enjoy the game."szName
        
client_cmdid"spk ^"sound/%s^""joining // copy and paste this line where you want the sound to play
    

    else if(
get_user_flags(id) & ADMIN_LEVEL_H
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see you VIP %s! Enjoy the game."szName
    } 
    else 
    { 
        
set_dhudmessage(025500.280.1606.012.0
        
show_dhudmessage(id"Glad to see you %s ! Enjoy the game."szName
    } 

      
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } 
*/ 
Why the "\n" didn't work?

PHP Code:
Glad to see the Administrator %s! [B]\n[/B]Enjoy the game
LithuanianJack is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 05-18-2016 , 01:19   Re: Plugin compile error (old plugin)
Reply With Quote #8

Quote:
Originally Posted by wickedd View Post
It compiles fine without any errors for me.

Edit: What version of AMXX are you using to compile the plugin with?

Edit 2: If you're using AMXX 1.8.3 remove
PHP Code:
#include <dhudmessage> 
then the plugin should compile
1.8.3 has dhudmessage by default?
tousif is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-18-2016 , 06:31   Re: Plugin compile error (old plugin)
Reply With Quote #9

Quote:
Originally Posted by LithuanianJack View Post
Why the "\n" didn't work?

PHP Code:
Glad to see the Administrator %s! [B]\n[/B]Enjoy the game
PHP Code:
Glad to see the Administrator %s!^nEnjoy the game
If you're want to start a new line use ^n

Quote:
Originally Posted by tousif View Post
1.8.3 has dhudmessage by default?
Yes
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 05-18-2016 , 07:29   Re: Plugin compile error (old plugin)
Reply With Quote #10

Quote:
Originally Posted by wickedd View Post
PHP Code:
Glad to see the Administrator %s!^nEnjoy the game
If you're want to start a new line use ^n


Yes
Yeah, but i didn't hear the sound
LithuanianJack is offline
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 18:32.


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