PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "New Plugin",
author = "Unknown",
description = "<- Description ->",
version = "1.0",
url = "<- URL ->"
}
public OnPluginStart( ) {
HookEvent( "round_start", OnRoundStart, EventHookMode_PostNoCopy )
}
public OnMapStart( ) {
PrecacheModel( "models/custom.mdl", true )
}
public OnRoundStart( Handle:event, const String:name[ ], bool:dontBroadcast ) {
for( new i = 1; i <= GetMaxEntities( ); i++ ) {
if( !IsValidEntity( i ) ) {
return Plugin_Handled
}
new String:classname[ 128 ]
GetEntityClassname( i, classname, sizeof( classname ) )
if( StrEqual( classname, "info_deathmatch_spawn" ) ) {
switch( GetRandomInt( 1, 2 ) ) {
case 1 : {
new entity = CreateEntityByName( "CustomEnt" )
if( ( entity != -1 ) && DispatchSpawn( entity ) ) {
SetEntityModel( entity, "models/custom.mdl" )
SetEntProp( entity, Prop_Send, "m_CollisionGroup", 2 )
new Float:position[ 3 ]
GetEntPropVector( classname, Prop_Send, "m_vecOrigin", position )
position[ 2 ] += 10
TeleportEntity( entity, position, NULL_VECTOR, NULL_VECTOR )
}
}
case 2 : {
// case 2 code, etc
}
}
}
}
return Plugin_Continue
}
So... this is my code. I knew from the begining that
GetEntPropVector( classname, can't work, but i don't know any other way that may retrieve info_deathmatch_spawn location.
I want to retrieve all deathmatch spawn locations and spawn my own entity in that spot. Can you help me please ?