pretty nice plugin
I test it in left4dead 1 server
and it works fine
the fix is working
But I found problems
1. everytime SI tries to spawns near or not near the saferoom door, it always call OnPlayerRunCmd function to check all the time
2. it stops SI spawning near the start safe room door
To solve above problems
I have an idea
The following code is provided for your reference
PHP Code:
public OnPluginStart()
{
..
..
..
HookEvent("round_start", Event_RoundStart, EventHookMode_Post);
HookEvent("door_open", Event_DoorOpen, EventHookMode_Post);
HookEvent("door_close", Event_DoorClose, EventHookMode_Post);
}
public Action:Event_RoundStart (Handle:event, const String:name[], bool:dontBroadcast)
{
// We mark the safe room door as open
SafeRoomDoorClosed = false;
return Plugin_Continue;
}
public Action:Event_DoorOpen (Handle:event, const String:name[], bool:dontBroadcast)
{
// if the door was a checkpoint door ...
new bool:checkpointdoor = GetEventBool(event, "checkpoint");
if (checkpointdoor == true)
{
PrintToChatAll("SaferoomDoor Open");
SafeRoomDoorClosed = false;
}
return Plugin_Continue;
}
public Action:Event_DoorClose(Handle:event, const String:name[], bool:dontBroadcast)
{
// if the door was a checkpoint door ...
new bool:checkpointdoor = GetEventBool(event, "checkpoint");
if (checkpointdoor == true)
{
PrintToChatAll("SaferoomDoor Close");
SafeRoomDoorClosed = true;
}
return Plugin_Continue;
}
public Action:OnPlayerRunCmd(SInfected, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2])
{
if(!(buttons & IN_ATTACK) || !SafeRoomDoorClosed)
return Plugin_Continue;
..
..
..
}
in versus, start saferoom door can't be closed
so survivors only trigger Event_DoorClose at the end saferoom door
__________________