Jump to content

ZombieCooKie

Members
  • Content Count

    34
  • Joined

  • Last visited

Everything posted by ZombieCooKie

  1. Because of the bug I decidet to spawn ready-to-drive cars on my server, so the players keep playing. There are four cars that spawn on every serverstart. If there is a car from previous start then it gets deleted before the new spawn. Just place this code at the end of the void main() in your init.c ref array<Object> nearest_objects = new array<Object>; ref array<CargoBase> proxy_cargos = new array<CargoBase>; int c_count; int c_count2; Car c_ada; TVectorArray c_positions = { "13292.6 5.99211 3987.3", "1844.24 5.71016 2121.89", "1980.96 258.426 7397.11", "12179.8 95.2326 13774.4", }; for (c_count2=0; c_count2 < c_positions.Count(); c_count2++) { GetGame().GetObjectsAtPosition ( c_positions[c_count2], 10, nearest_objects, proxy_cargos ); for (c_count = 0; c_count < nearest_objects.Count(); c_count++) { if (nearest_objects.Get(c_count).IsKindOf("CarScript")) { c_ada = Car.Cast(nearest_objects[c_count]); GetGame().ObjectDelete(c_ada); } } c_ada = Car.Cast(GetGame().CreateObject( "OffroadHatchback", c_positions[c_count2], false, true, true )); c_ada.GetInventory().CreateAttachment("HatchbackHood"); c_ada.GetInventory().CreateAttachment("HatchbackTrunk"); c_ada.GetInventory().CreateAttachment("HatchbackDoors_CoDriver"); c_ada.GetInventory().CreateAttachment("HatchbackWheel"); c_ada.GetInventory().CreateAttachment("HatchbackWheel"); c_ada.GetInventory().CreateAttachment("HatchbackWheel"); c_ada.GetInventory().CreateAttachment("HatchbackWheel"); c_ada.GetInventory().CreateAttachment("SparkPlug"); c_ada.GetInventory().CreateAttachment("EngineBelt"); c_ada.GetInventory().CreateAttachment("CarRadiator"); c_ada.GetInventory().CreateAttachment("CarBattery"); c_ada.Fill( CarFluid.FUEL, c_ada.GetFluidCapacity( CarFluid.FUEL ) ); c_ada.Fill( CarFluid.OIL, c_ada.GetFluidCapacity( CarFluid.OIL ) ); c_ada.Fill( CarFluid.BRAKE, c_ada.GetFluidCapacity( CarFluid.BRAKE ) ); c_ada.Fill( CarFluid.COOLANT, c_ada.GetFluidCapacity( CarFluid.COOLANT ) ); } The positions are Cernaya Polana, Myshkino, Kamenka and the houses on the street near Krutoy Cap. You can edit the positions in the code. Hope that helps to keep players playing.
  2. ZombieCooKie

    Workaround for cars bugging in the ground

    Maybe the height can be 0.0. The coordinates in the code are verified to work. Never change a running system :)
  3. ZombieCooKie

    Workaround for cars bugging in the ground

    Edited because forgot the radiator
  4. ZombieCooKie

    COmmunity online tools player files not showing

    Just read the documentation:
  5. ZombieCooKie

    Need short help for correct syntax

    I want to send message to players with survivor in name. I need the correct syntax for the if section. if (player.GetIdentity().GetName() contains? "Survivor") { ... }
  6. ZombieCooKie

    Need short help for correct syntax

    This works. Thank you :)
  7. ZombieCooKie

    cfgPlayerSpawnPoints.xml Help

    Need help with spawn points I have custom spawn points inside an area, but somtimes the player spawns outside. I think the problem is located in <spawn_params> but I don't know the meaning of this... <spawn_params> <min_dist_zombie>10.0</min_dist_zombie> <max_dist_zombie>30.0</max_dist_zombie> <min_dist_player>10.0</min_dist_player> <max_dist_player>30.0</max_dist_player> <min_dist_static>0.5</min_dist_static> <max_dist_static>2.0</max_dist_static> </spawn_params>
  8. ZombieCooKie

    Kill Feed

    It's explained all above
  9. ZombieCooKie

    pvp zone

    Nothing is wrong. This is a pvp zone, so you have to stay there. If you leave the zone you get damage.
  10. ZombieCooKie

    Safe Zones

    The script above doesn't work standalone.
  11. ZombieCooKie

    pvp zone

    Put everything in the init.c
  12. ZombieCooKie

    Server restart timer

    You can do this with BEC Scheduler http://ibattle.org/ http://ibattle.org/install-and-configure/setting-up-the-scheduler/
  13. ZombieCooKie

    pvp zone

    So, I installed it on my server and it works as expected. Please note the added COMMENTS (Translation by google) static vector zonepvp_pos1 = {5231.25, 0, 9820.31};// point1 static vector zonepvp_pos2 = {2321.25, 0, 8452.31};// point2 override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 60000, true); // 10 min // DOES NOT BELONG TO PVP ZONE!!! super.OnInit(); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckPVPZone, 5000, true); //pvp //CHANGED TO 5 SECONDS TO AVOID SERVER STRESS } void CheckPVPZone()//pvp { bool in_zone1 = true; bool in_zone2 = true; ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); if ( players.Count() > 0 ) { for ( int i = 0; i < players.Count(); i++ ) { PlayerBase player; Class.CastTo(player, players.Get(i)); float dist1 = vector.Distance(player.GetPosition(),zonepvp_pos1); float dist2 = vector.Distance(player.GetPosition(),zonepvp_pos2); if (dist1 > 346) in_zone1 = false; //DISTANCE ZONE 1 if (dist2 > 346) in_zone2 = false;// DISTANCE ZONE 2 if(!in_zone1 && !in_zone2) //distance from the center to the player, from where the player will receive warnings and damage { float newHeal = player.GetHealth("", "") - 5; //5 - this is damage to the player //CHANGED TO 5 BECAUSE OF TIME-CHANGE ABOVE player.SetHealth("", "", newHeal); string messPlayers = "Hey, you (" + player.GetIdentity().GetName() + ") go back, and then is healthy!"; Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } }
  14. ZombieCooKie

    Experimental database wipe?

    ...
  15. ZombieCooKie

    pvp zone

    Ok, sorry I'm out. Can't see the error :( If nobody can help you I will try it again next weekend.
  16. ZombieCooKie

    pvp zone

    try this static vector zonepvp_pos1 = {5231.25, 0, 9820.31};// point1 static vector zonepvp_pos2 = {2321.25, 0, 8452.31};// point2 override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 60000, true); // 10 min super.OnInit(); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckPVPZone, 1000, true); //pvp } void CheckPVPZone()//pvp { bool in_zone1 = true; bool in_zone2 = true; ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); if ( players.Count() > 0 ) { for ( int i = 0; i < players.Count(); i++ ) { PlayerBase player; Class.CastTo(player, players.Get(i)); float dist1 = vector.Distance(player.GetPosition(),zonepvp_pos1); float dist2 = vector.Distance(player.GetPosition(),zonepvp_pos2); if (dist1 > 346) in_zone1 = false; if (dist2 > 346) in_zone2 = false; if(!in_zone1 && !in_zone2) //дистанция от центра к игроку, откуда игрок будет получать предупреждения и урон { float newHeal = player.GetHealth("", "") - 1; //1 - это урон для игрока player.SetHealth("", "", newHeal); string messPlayers = "эй ты (" + player.GetIdentity().GetName() + ") пиздуй обратно, а то здохнеш!"; Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } }
  17. ZombieCooKie

    pvp zone

    which code do you use? The code you posted below my code only checks 1 zone. EDIT: Wait a moment. this couldn't work. I'll be back soon.
  18. ZombieCooKie

    pvp zone

    Sorry... static vector zonepvp_pos1 = {2321.25, 0, 8452.31};// point2 should be static vector zonepvp_pos2 = {2321.25, 0, 8452.31};// point2
  19. ZombieCooKie

    pvp zone

    This should work (not testet) static vector zonepvp_pos1 = {5231.25, 0, 9820.31};// point1 static vector zonepvp_pos1 = {2321.25, 0, 8452.31};// point2 override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 60000, true); // 10 min super.OnInit(); GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckPVPZone, 1000, true); //pvp } void CheckPVPZone()//pvp { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); if ( players.Count() > 0 ) { for ( int i = 0; i < players.Count(); i++ ) { PlayerBase player; Class.CastTo(player, players.Get(i)); float dist1 = vector.Distance(player.GetPosition(),zonepvp_pos1); float dist2 = vector.Distance(player.GetPosition(),zonepvp_pos2); if(dist1 > 346 && dist2 > 346) //дистанция от центра к игроку, откуда игрок будет получать предупреждения и урон { float newHeal = player.GetHealth("", "") - 1; //1 - это урон для игрока player.SetHealth("", "", newHeal); string messPlayers = "эй ты (" + player.GetIdentity().GetName() + ") пиздуй обратно, а то здохнеш!"; Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } }
  20. Don`t know if it works... Change the Lifetime parameter in types.xml
  21. ZombieCooKie

    Kill Feed

    Just do what he say... Insert this in SurvivorBase.c private string PlayerIdentityName = "empty"; string GetPlayerIdentityName() { return this.PlayerIdentityName; } void SetPlayerIdentityName(string name) { this.PlayerIdentityName = name; } Insert this in PlayerBase.c (search forr eekilled for the right position) SurvivorBase sbKilled = this; if (killer.IsMan()) { Man manKiller = Man.Cast(killer); GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed By " + manKiller.GetIdentity().GetName()); } else { GetGame().ChatPlayer( 0, sbKilled.GetPlayerIdentityName() + " Killed by zombie/bleedout/fall?"); } and this too (search for onconnect for right position) SurvivorBase sb = this; sb.SetPlayerIdentityName(this.GetIdentity().GetName()); That's it
  22. ZombieCooKie

    Kill Feed

    Extract scipts.pbo and place the files in a directory named "scripts" in the server root. Then follow the instruction from the tread i've quotet. Playerbase.c is locatet in scripts\4_World\Entities\ManBase Survivorbase is in scripts\4_World\Entities\ManBase\PlayerBase Thats all
  23. ZombieCooKie

    Kill Feed

    This works for me...
  24. ZombieCooKie

    fast slot magazines

    Ok, I have not really a plan of c# or c++ or what ever this is :) Remember, this only sets 3 magazines. The count parameter is not read anymore.
×