PDA

View Full Version : [l4d2]chance of you getting infected?


gamemann
11-21-2011, 16:19
Hello i searched all around for this plugin and i am surprised that i didn't find anything O.o

Can someone please make a plugin where, there is a chance of getting hit by special infected or common infected either one, you get infected and like 2 minutes later you turn into a common infected or tank, but to tell if your infected, it says it to the person that is infected, and you start noticing side affects when your infected such as drug effect and all of that.
Seems like an awesome plugin!
Please someone make this!

gamemann
11-23-2011, 15:13
anyone?

gamemann
11-25-2011, 18:35
Well i'll try to make it i guess. Im not good at it but if you read this message can you try to make it for me :D
I probably won't get far in it since i really don't know how to make plugins like this....

Skyy
11-25-2011, 19:05
There's another plugin similar to this on the ideas thread... As it was explained, attempting to change a player into a common zombie results in TPose, and the inability to attack, etc.

gamemann
11-25-2011, 20:34
There's another plugin similar to this on the ideas thread... As it was explained, attempting to change a player into a common zombie results in TPose, and the inability to attack, etc.

Can you please tell me it :D


btw if there isn't i tried coding the plugin!
I didn't get far though.

#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.00"
#define MAX_PLAYERS 256

public Plugin:myinfo = {
name = "Infected",
description = "Chance of getting infected",
author = "Gamemann",
version = PLUGIN_VERSION,
url = "http://gfl-clan.net"
};

/*
*******************************
This plugin makes it so when you get hit by a zombie you have a chance of becoming infected
*******************************
*/


//Handles and ConVars
new Handle:InfectedTimer = INVALID_HANDLE;
new Handle:InfectedChance = INVALID_HANDLE;
new InfectedTime[MAX_PLAYERS + 1];


//now to call plugin start
public OnPluginStart()
{
//Create Version ConVar to Become Approved On AlliedModders
CreateConVar("infected_version", PLUGIN_VERSION, "Plugin's version");
//Create Other ConVars
InfectedTimer = CreateConVar("infected_timer", "30.0", "Time after being infected, the death will take place.");
InfectedChance = CreateConVar("infected_chance", "10", "Chance out of 100, that you will get infected.");
//Events To Call
HookEvent("player_hurt", Event_PlayerHurt);
AutoExecConfig(true, "infection");
}

public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new client=1; client <= MaxClients; client++)
{
new chance = GetRandomInt(GetConVarInt(InfectedChance),100 );
if(chance)
{
InfectedTime[client] = CreateTimer(GetConVarFloat(InfectedTimer), Death);
CreateTimer(5.00, DrugsOn);
CreateTimer(15.00, DrugsOff);
}
}
}

public Action:DrugsOn(Handle:timer, any:client)
{
decl String:name[65];
GetClientName(client, name, sizeof(name));
ServerCommand("sm_drugs %s", name);
return Plugin_Continue;
}

public Action:DrugsOff(Handle:timer, any:client)
{
decl String:name[65];
GetClientName(client, name, sizeof(name));
ServerCommand("sm_drugs %s", name);
return Plugin_Continue;
}

public Action:Death(Handle:timer, any:client)
{
if(IsClientInGame(client))
{
decl String:name[65];
GetClientName(client, name, sizeof(name));
ServerCommand("sm_slay %s");
//FOR ALLIEDMODDERS PEOPLE: How do i make it so i don't need sv_cheats 1 on? I know there is a way!
ServerCommand("z_spawn witch");
}
return Plugin_Continue;
}