 |
|
Senior Member
|

02-11-2022
, 07:10
Re: 8 survivors in the rescue vehicle
|
#29
|
Quote:
Originally Posted by sorallll
Currently I use this and it works fine
PHP Code:
HookEvent("finale_vehicle_leaving", Event_FinaleVehicleLeaving);
void Event_FinaleVehicleLeaving(Event event, const char[] name, bool dontBroadcast) { int entity = FindEntityByClassname(MaxClients + 1, "info_survivor_position"); if(entity == INVALID_ENT_REFERENCE) return;
float vOrigin[3]; GetEntPropVector(entity, Prop_Send, "m_vecOrigin", vOrigin);
int iSurvivor; static const char sOrder[][] = {"1", "2", "3", "4"}; for(int i = 1; i <= MaxClients; i++) { if(!IsClientInGame(i) || GetClientTeam(i) != TEAM_SURVIVOR) continue; if(++iSurvivor < 4) continue; entity = CreateEntityByName("info_survivor_position"); DispatchKeyValue(entity, "Order", sOrder[iSurvivor - RoundToFloor(iSurvivor / 4.0) * 4]); TeleportEntity(entity, vOrigin, NULL_VECTOR, NULL_VECTOR); DispatchSpawn(entity); } }
|
Entity info_survivor_position is needed even for spawn players so that they do not spawn at one point. I think use Striper it is better idea to set unique coordinates for each info_survivor_position
__________________
-
PHP Code:
public OnClientConnect(int Client) {
KickClient(Client, "sorry");
}
Last edited by Gold Fish; 02-11-2022 at 07:11.
|
|
|
|