TPOLI,KUU[B/IKCM] |
22.11.2009 02:22 |
В L нету телепорта первого зомби.
Но есть скрипт под сорсмод, который позволяет телепортировать всех зомби через заданный промежуток времени (в чем то даже интереснее, т.к. зомби портнется не сразу, а может успеет кого-нибудь еще цапнуть и портнется уже вместе с ним)
Код:
#include <sourcemod>
#include <sdktools_functions>
#include <sdktools>
#include <cstrike>
#include <hacks>
#define VERSION "1.0"
new Float:spawnLoc[MAXPLAYERS+1][3];
new Handle:Switch;
new Handle:tLIMIT;
new bool: aRestrict[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "zm_tele",
author = "TPOLI,KUU[B/IKCM]",
description = "tele zombie",
version = VERSION,
url = "www.sourcemod.net"
};
public OnPluginStart()
{
Switch = CreateConVar("tele_on","1","Turns the plugin on and off 1/0",FCVAR_NOTIFY);
tLIMIT = CreateConVar("time_tele","20.0","time v sec");
HookEvent("round_freeze_end", RoundFreezeEnd);
HookEvent("player_spawn", PlayerSpawn);
AutoExecConfig(true, "zm_tele");
}
public RoundFreezeEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
new Float:time = GetConVarFloat(tLIMIT);
CreateTimer(time, TeleZombie, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action:TeleZombie(Handle:timer)
{
new maxplayers = GetMaxClients();
for (new i = 1; i <= maxplayers; i++)
{
if (GetClientHealth(i) > 100 && GetConVarInt(Switch) && aRestrict[i] != true)
{
TeleportEntity(i, spawnLoc[i], NULL_VECTOR, NULL_VECTOR);
aRestrict[i] = true;
}
}
}
//-----------------------------------------------------------------------------------------------------
public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
GetClientAbsOrigin(client, spawnLoc[client]);
new Float:time = GetConVarFloat(tLIMIT);
CreateTimer(time+5.0, TeleZombie2, client, TIMER_FLAG_NO_MAPCHANGE);
aRestrict[client] = false;
}
public Action:TeleZombie2(Handle:timer, any:index)
{
if (GetClientHealth(index) > 100 && GetConVarInt(Switch) && aRestrict[index] != true)
{
TeleportEntity(index, spawnLoc[index], NULL_VECTOR, NULL_VECTOR);
aRestrict[index] = true;
}
}
|