AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Two in one... (https://forums.alliedmods.net/showthread.php?t=105206)

edga85 10-02-2009 10:39

Two in one...
 
Can someone Make one plugin from this two????
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN_NAME "[ZP] Survivors Health"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "IneedHelp"
#define TASK_HEALTH 1234554321
new g_iHudSync
public plugin_init() 
{
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)

//
g_iHudSync CreateHudSyncObj()

// Fwd's
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled_Pre"0)
}
public 
Fwd_PlayerSpawn_Post(id)
{
if (
task_exists(id+TASK_HEALTH))
remove_task(id+TASK_HEALTH)
}
public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
if (
task_exists(victim+TASK_HEALTH))
remove_task(victim+TASK_HEALTH)
}
public 
zp_round_started(modeid)
{
if (
mode != MODE_SURVIVOR)
return

if (!
zp_get_user_survivor(id))
return

set_task(1.0"Task_ShowHealth"id+TASK_HEALTH__"b")
}
public 
Task_ShowHealth(id)
{
id -= TASK_HEALTH

if (!zp_get_user_survivor(id))
remove_task(id+TASK_HEALTH)

set_hudmessage(00255, -1.00.201.01.00.10.2, -1)
ShowSyncHudMsg(0g_iHudSync"Survivor Health: %d"get_user_health(id))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
*/ 


PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN_NAME "[ZP] Nemesis Health"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "IneedHelp"
#define TASK_HEALTH 1234554321
new g_iHudSync
public plugin_init() 
{
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)

//
g_iHudSync CreateHudSyncObj()

// Fwd's
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled_Pre"0)
}
public 
Fwd_PlayerSpawn_Post(id)
{
if (
task_exists(id+TASK_HEALTH))
remove_task(id+TASK_HEALTH)
}
public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
if (
task_exists(victim+TASK_HEALTH))
remove_task(victim+TASK_HEALTH)
}
public 
zp_round_started(modeid)
{
if (
mode != MODE_NEMESIS)
return

if (!
zp_get_user_nemesis(id))
return

set_task(1.0"Task_ShowHealth"id+TASK_HEALTH__"b")
}
public 
Task_ShowHealth(id)
{
id -= TASK_HEALTH

if (!zp_get_user_nemesis(id))
remove_task(id+TASK_HEALTH)

set_hudmessage(25500, -1.00.201.01.00.10.2, -1)
ShowSyncHudMsg(0g_iHudSync"Nemesis Health: %d"get_user_health(id))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
*/ 

</SPAN></SPAN>

fysiks 10-02-2009 20:16

Re: Two in one...
 
Why? Just use them as two plugins.

edga85 10-03-2009 06:47

Re: Two in one...
 
Pls
In one better...(i think)

meigyoku 10-03-2009 08:32

Re: Two in one...
 
How to make one plugin connect two plugins? I think it's impossible!

edga85 10-03-2009 09:52

Re: Two in one...
 
No no...
I need that from these two plugins make One plugin....

joropito 10-03-2009 10:32

Re: Two in one...
 
1 Attachment(s)
Quote:

Originally Posted by edga85 (Post 950921)
No no...
I need that from these two plugins make One plugin....

Check if it works.
I have not tried yet.

SnoW 10-03-2009 10:45

Re: Two in one...
 
Quote:

Originally Posted by meigyoku (Post 950871)
How to make one plugin connect two plugins? I think it's impossible!

There's many ways to do that.
Quote:

Originally Posted by edga85 (Post 950921)
No no...
I need that from these two plugins make One plugin....

Useless if you don't have a better reason.

edga85 10-03-2009 12:53

Re: Two in one...
 
Quote:

Originally Posted by joropito (Post 950938)
Check if it works.
I have not tried yet.

Can you make
PHP Code:

set_hudmessage(25500, -1.00.201.01.00.10.2, -1)
ShowSyncHudMsg(0g_iHudSync"Special Health: %d"get_user_health(id)) 

2 because you will not understand whos hp or nemesis or Survivor..... ( Can you make 2 hudmesagges , 1 for Nemesis hp other for Survivor HP )
And ty for helping
Quote:

Originally Posted by SnoW (Post 950952)
There's many ways to do that.

Useless if you don't have a better reason.

I think in one plugin there will be less Lag

joropito 10-03-2009 14:45

Re: Two in one...
 
Change this

PHP Code:

ShowSyncHudMsg(0g_iHudSync"Special Health: %d"get_user_health(id)) 

To this
PHP Code:

ShowSyncHudMsg(0g_iHudSync"%s Health: %d"zp_get_user_survivor(id) ? "Survivor" "Nemesis"get_user_health(id)) 

And test it.

SnoW 10-03-2009 14:45

Re: Two in one...
 
Quote:

Originally Posted by edga85 (Post 951083)
I think in one plugin there will be less Lag

You could notice the lagg with an accurate calculator if you had thousands of plugins using prethink and combined them but yea, No.


All times are GMT -4. The time now is 22:38.

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