Welcome msg plugin

Unpaid Requests, Public Plugins
Post Reply
User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

Welcome msg plugin

#1

Post by sPe3doN » 5 years ago

Hi can someone help me here when i use this plugin in normal mod msg show for 10 sec but when i use it in ZE mod show it only for 1 sec

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Welcome Msg"
#define VERSION "1.0"
#define AUTHOR "GmTx"

new bool:gbSpawned[33];

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
}

public client_connect(id)
{
    gbSpawned[id] = false;
}

public Player_Spawn(id)
{
    if(!gbSpawned[id] && is_user_alive(id))
    {
         new name[32]
        get_user_name(id, name, 31)
        set_hudmessage(0, 0, 255, -1.0, -1.0)
        show_hudmessage(id, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
    }     
}
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years ago

I used SyncObject to ensure that this message won't be overwritten, try:
  • Code: Select all

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>
    
    #define PLUGIN "Welcome Msg"
    #define VERSION "1.0"
    #define AUTHOR "GmTx"
    
    new bool:gbSpawned[33];
    
    new g_iHUDSyncObject
    
    public plugin_init() 
    {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        
        RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
        
        g_iHUDSyncObject = CreateHudSyncObj()
    }
    
    public client_connect(id)
    {
        gbSpawned[id] = false;
    }
    
    public Player_Spawn(id)
    {
        if(!gbSpawned[id] && is_user_alive(id))
        {
            new name[32]
            get_user_name(id, name, 31)
            set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 1.0, 8.0, 0.1, 0.2)
            ShowSyncHudMsg(id, g_iHUDSyncObject, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
        }
    }
He who fails to plan is planning to fail

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#3

Post by sPe3doN » 5 years ago

Raheem wrote: 5 years ago I used SyncObject to ensure that this message won't be overwritten, try:
  • Code: Select all

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>
    
    #define PLUGIN "Welcome Msg"
    #define VERSION "1.0"
    #define AUTHOR "GmTx"
    
    new bool:gbSpawned[33];
    
    new g_iHUDSyncObject
    
    public plugin_init() 
    {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        
        RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
        
        g_iHUDSyncObject = CreateHudSyncObj()
    }
    
    public client_connect(id)
    {
        gbSpawned[id] = false;
    }
    
    public Player_Spawn(id)
    {
        if(!gbSpawned[id] && is_user_alive(id))
        {
            new name[32]
            get_user_name(id, name, 31)
            set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 1.0, 8.0, 0.1, 0.2)
            ShowSyncHudMsg(id, g_iHUDSyncObject, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
        }
    }
The same problem don't work
Image

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#4

Post by sPe3doN » 5 years ago

help here
Image

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#5

Post by Night Fury » 5 years ago

  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <hamsandwich>
  4.  
  5. #define PLUGIN "Welcome Msg"
  6. #define VERSION "1.0"
  7. #define AUTHOR "GmTx"
  8.  
  9. new bool:gbSpawned[33];
  10.  
  11. public plugin_init()
  12. {
  13.     register_plugin(PLUGIN, VERSION, AUTHOR)
  14.    
  15.     RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
  16. }
  17.  
  18. public client_connect(id)
  19. {
  20.     gbSpawned[id] = false;
  21. }
  22.  
  23. public Player_Spawn(id)
  24. {
  25.     if(!gbSpawned[id] && is_user_alive(id))
  26.     {
  27.         set_task(10.0, "ShowMsg", id, _, _, "b")
  28.     }    
  29. }
  30.  
  31. public ShowMsg(id)
  32. {
  33.     new name[32]
  34.     get_user_name(id, name, 31)
  35.     set_hudmessage(0, 0, 255, -1.0, -1.0)
  36.     show_hudmessage(id, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
  37. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 5 years ago

This message will show forever jack, he need it only 10 seconds.
Task is good idea :)
He who fails to plan is planning to fail

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#7

Post by sPe3doN » 5 years ago

Raheem wrote: 5 years ago This message will show forever jack, he need it only 10 seconds.
Task is good idea :)
yes its for ever and i want only first 10 seconds jack
Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#8

Post by Spir0x » 5 years ago

I want this plugin too fix it please.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#9

Post by Raheem » 5 years ago

Try:
  • Code: Select all

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>
    
    #define PLUGIN "Welcome Msg"
    #define VERSION "1.0"
    #define AUTHOR "GmTx"
    
    new bool:gbSpawned[33], Float:g_flStartTime[33];
    
    new g_iHUDSyncObject
    
    public plugin_init() 
    {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        
        RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
        
        g_iHUDSyncObject = CreateHudSyncObj()
    }
    
    public client_connect(id)
    {
        gbSpawned[id] = false;
    }
    
    public Player_Spawn(id)
    {
        if(!gbSpawned[id] && is_user_alive(id))
        {
    		set_task(0.5, "ShowMsg", id, _, _, "b")
    		
    		g_flStartTime[id] = get_gametime()
        }
    }
    
    public ShowMsg(id)
    {
    	if (g_flStartTime[id] + 10.0 >= get_gametime())
    	{
    		remove_task(id)
    		g_flStartTime[id] = 0.0
    		return
    	}
    	
    	new name[32]
    	get_user_name(id, name, 31)
    	set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 1.0, 0.5, 0.1, 0.2)
    	ShowSyncHudMsg(id, g_iHUDSyncObject, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
    }
He who fails to plan is planning to fail

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#10

Post by sPe3doN » 5 years ago

Raheem wrote: 5 years ago Try:
  • Code: Select all

    #include <amxmodx>
    #include <amxmisc>
    #include <hamsandwich>
    
    #define PLUGIN "Welcome Msg"
    #define VERSION "1.0"
    #define AUTHOR "GmTx"
    
    new bool:gbSpawned[33], Float:g_flStartTime[33];
    
    new g_iHUDSyncObject
    
    public plugin_init() 
    {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        
        RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
        
        g_iHUDSyncObject = CreateHudSyncObj()
    }
    
    public client_connect(id)
    {
        gbSpawned[id] = false;
    }
    
    public Player_Spawn(id)
    {
        if(!gbSpawned[id] && is_user_alive(id))
        {
    		set_task(0.5, "ShowMsg", id, _, _, "b")
    		
    		g_flStartTime[id] = get_gametime()
        }
    }
    
    public ShowMsg(id)
    {
    	if (g_flStartTime[id] + 10.0 >= get_gametime())
    	{
    		remove_task(id)
    		g_flStartTime[id] = 0.0
    		return
    	}
    	
    	new name[32]
    	get_user_name(id, name, 31)
    	set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 1.0, 0.5, 0.1, 0.2)
    	ShowSyncHudMsg(id, g_iHUDSyncObject, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
    }
not work
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#11

Post by Raheem » 5 years ago

Explain what the problem you faced....
He who fails to plan is planning to fail

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#12

Post by sPe3doN » 5 years ago

Raheem wrote: 5 years ago Explain what the problem you faced....
not show the msg
Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#13

Post by Spir0x » 5 years ago

Yes same problem the hud message never appears.

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 6 years ago
Contact:

#14

Post by SexY DeviL CJ » 5 years ago

Check your server console it must throw some error if your plugin is not showing up in server check your logs in your panel
......Devil Was Here......

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#15

Post by sPe3doN » 5 years ago

SexY DeviL CJ wrote: 5 years ago Check your server console it must throw some error if your plugin is not showing up in server check your logs in your panel
I check it befor plugin dont have any error in consol
Image

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#16

Post by sPe3doN » 5 years ago

can't fixed ?
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#17

Post by Raheem » 5 years ago

  1. #include <amxmodx>
  2. #include <hamsandwich>
  3.  
  4. #define PLUGIN "Welcome Msg"
  5. #define VERSION "1.0"
  6. #define AUTHOR "GmTx"
  7.  
  8. public plugin_init()
  9. {
  10.     register_plugin(PLUGIN, VERSION, AUTHOR)
  11.    
  12.     RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
  13. }
  14.  
  15. public Player_Spawn(id)
  16. {
  17.     set_task(0.5, "ShowMsg", id, _, _, "a", 20)
  18. }
  19.  
  20. public ShowMsg(id)
  21. {
  22.     new name[32]
  23.     get_user_name(id, name, 31)
  24.    
  25.     set_hudmessage(0, 255, 0, -1.0, 0.35, 0, 1.0, 0.5, 0.1, 0.2)
  26.     show_hudmessage(id, "Welcome %s to zombie escape mod^nEnjoy with us GL have fun", name)
  27. }
  28.  
  29. public client_disconnected(id)
  30. {
  31.     remove_task(id)
  32. }
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests