sup guys, need little help, tnx Wiskyjim for plugin
i use your code, this is main function.
PHP Code:
SaveAllEntities(Client)
{
new Float:iVec[3];
new Float:iAng[3];
new String:m_ModelName[255];
new String:map[64];
GetCurrentMap(map, sizeof(map));
new String:path[255];
Format(path, sizeof(path), "addons/stripper/maps/%s.cfg", map);
new Handle:file = OpenFile(path, "wt");
if (file == INVALID_HANDLE)
{
LogError("Could not open spawn point file \"%s\" for writing.", path);
return false;
}
WriteFileLine(file, "add:");
PrintToChat(Client, "ShitStorm start");
for( new i = 0; i < GetArraySize(h_arraySpawnedItems[Client]); i++ )
{
new ent = GetArrayCell( h_arraySpawnedItems[Client], i);
if( IsValidEntity(ent))
{
GetEntPropVector(ent, Prop_Data, "m_vecOrigin", iVec);
GetEntPropVector(ent, Prop_Data, "m_angRotation", iAng);
GetEntPropString(ent, Prop_Data, "m_ModelName", m_ModelName, sizeof(m_ModelName));
PrintToChat(Client, "[%f %f %f][%f %f %f]",iVec[0],iVec[1],iVec[2],iAng[0],iAng[1],iAng[2]);
WriteFileLine(file, "{");
WriteFileLine(file, "\"origin\" \"%f %f %f\"",
iVec[0],
iVec[1],
iVec[2]);
WriteFileLine(file, "\"angles\" \"%f %f %f\"",
iAng[0],
iAng[1],
iAng[2]);
WriteFileLine(file, "\"classname\" \"prop_physics\"");
WriteFileLine(file, "\"model\" \"%s\"",
m_ModelName);
WriteFileLine(file, "}");
}
}
CloseHandle(file);
PrintToChat(Client, "ShitStorm [%i]",GetArraySize(h_arraySpawnedItems[Client]));
return true;
}
so this function save config file for stripper
Code:
add:
{
"origin" "-680.252258 -601.501403 0.031250"
"angles" "0.000000 0.168284 0.000000"
"classname" "prop_physics"
"model" "models\props_fortifications/concrete_wall001_96_reference.mdl"
}
{
"origin" "-680.422485 -543.650878 0.031250"
"angles" "0.000000 0.168284 0.000000"
"classname" "prop_physics"
"model" "models\props_fortifications/concrete_wall001_96_reference.mdl"
}
looks like it's working but props not spawn when i reload map
and i don't get why, can you guys help me fix the problem
__________________