Raised This Month: $ Target: $400
 0% 

[l4d2]Can anyone make this plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 01-22-2010 , 20:51   Re: [l4d2]Can anyone make this plugin?
Reply With Quote #11

here is my code (also i haevn't test it the plugin yet well the latest version...Also i got notepad++ and found the errors with it because it has lines. So now there isn't no warnings or errors at all but am not sure if it works.. Here is the code:
PHP Code:
#include <sourcemod>
#include <sdktools_functions>
#include <sdktools>
&#12288;
&#12288;
new Handle:PlayerDeathTimer INVALID_HANDLE;
public 
Plugin:myinfo =
{
name "OnPlayerDeath",
author "gamemann",
description "When a player dies they get a timer and when the timer is finished they spawn back again.",
version "1",
url "http://sourcemod.net/",
};
public 
OnPluginStart()
{
decl String:game_name[64];
GetGameFolderName(game_namesizeof(game_name));
if (!
StrEqual(game_name"left4dead2"false))
SetFailState("Plugin supports Left 4 Dead 2 only.");
 
       
PlayerDeathTimer CreateConVar("sm_player_spawn_time""45""how many seconds it takes until the player spawns"FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_SPONLYtrue1.00true900.00);
 
      
SetConVarBounds(PlayerDeathTimerConVarBound_Lowertrue,1.00);
 
      
CreateConVar("sm_plugin_version""1""the plugins version"FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
      
HookEvent("player_death"PlayerDeath);
//hooking convarchanges
 
      
HookConVarChange(PlayerDeathTimerConVarChanged);
 
//load our config
 
      
AutoExecConfig(true"l4d2playerdeathtimerspawner");
      
UpgradeConVars();
}
 
public 
OnMapStart()
{
       
UpgradeConVars();
}
 
 
public 
ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
       
UpgradeConVars();
}
 
 
UpgradeConVars()
{
      
SetConVarInt(FindConVar("player_death_time"), GetConVarInt(PlayerDeathTimer));
}
 
 
public 
PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
      
CreateTimer(45.0,PlayerDeathT,TIMER_REPEAT);
      return;
}
 
 
public 
Action:PlayerDeathT(Handle:htimerany:Client)
{
     
SpawnClient()
}
 
 
SpawnClient()
{
// Spawn bot survivor.
 
     
new Bot SpawnClient();
     if(
Bot == 0
     return;
 
     
ChangeClientTeam(Bot2);
     
DispatchKeyValue(Bot"classname""SurvivorBot");

Here is another code:
Code:
#include <sourcemod>
#include <sdktools_functions>
#include <sdktools>
 
 
new Handle:PlayerDeathTimer = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "OnPlayerDeath",
author = "gamemann",
description = "When a player dies they get a timer and when the timer is finished they spawn back again.",
version = "1",
url = "http://sourcemod.net/",
};
public OnPluginStart()
{
decl String:game_name[64];
GetGameFolderName(game_name, sizeof(game_name));
if (!StrEqual(game_name, "left4dead2", false))
SetFailState("Plugin supports Left 4 Dead 2 only.");
PlayerDeathTimer = CreateConVar("sm_player_spawn_time", "45", "how many seconds it takes until the player spawns", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_SPONLY, true, 1.00, true, 900.00);
SetConVarBounds(PlayerDeathTimer, ConVarBound_Lower, true,1.00);
CreateConVar("sm_plugin_version", "1", "the plugins version", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
HookEvent("player_death", PlayerDeath);
//hooking convarchanges
HookConVarChange(PlayerDeathTimer, ConVarChanged);
//load our config
AutoExecConfig(true, "l4d2playerdeathtimerspawner");
UpgradeConVars();
}
public OnMapStart()
{
UpgradeConVars();
}
public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
UpgradeConVars();
}
UpgradeConVars()
{
SetConVarInt(FindConVar("player_death_time"), GetConVarInt(PlayerDeathTimer));
}
public PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
CreateTimer(45.0,PlayerDeathT,TIMER_REPEAT);
return;
}
public Action:PlayerDeathT(Handle:htimer, any:Client)
{
SpawnClient()
}
SpawnClient()
{
// Spawn bot survivor.
new Bot = SpawnClient();
if(Bot == 0) 
return;
ChangeClientTeam(Bot, 2);
DispatchKeyValue(Bot, "classname", "SurvivorBot");
}
The only thing before was when the bots spawn, about 5 seconds later they disapear...


</SPAN>
Attached Files
File Type: smx OnPlayer_Death.smx (3.3 KB, 86 views)
File Type: sp Get Plugin or Get Source (OnPlayer_Death.sp - 234 views - 1.8 KB)
gamemann is offline
Send a message via Skype™ to gamemann
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 01-23-2010 , 00:30   Re: [l4d2]Can anyone make this plugin?
Reply With Quote #12

bump
gamemann is offline
Send a message via Skype™ to gamemann
gamemann
Veteran Member
Join Date: Sep 2009
Location: Mullica Hill, New Jersey
Old 01-23-2010 , 13:26   Re: [l4d2]Can anyone make this plugin?
Reply With Quote #13

anyone???
gamemann is offline
Send a message via Skype™ to gamemann
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 21:31.


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