Request Last survivour
#1
so i can add extra points or weapons, perks etc? has one been released as i haven't come across one.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#2
(09-26-2013, 16:25)hillbilly Wrote: so i can add extra points or weapons, perks etc? has one been released as i haven't come across one.

http://www.itsmods.com/forum/Thread-Rele...class.html

I created a class for detecting the last survivor a while ago, you can try to use that.
Reply

#3
Simple mathematics.

Use GetClients() to get all clients. Then create common variable to save last count of all players and one 'in-method' variable to update players. Then just minus alive players from common count. Obviously it is looped. I did it in my kzm mod. Worked perfectly... but don't forget to reset common variable to reset player count at map start!
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
http://forum.hard-zombie.com/index.php?/...%B8%D0%B9/
Code:
using System; using System.Collections.Generic; using System.Linq; using Addon; using System.Text; namespace LastAllies { public class main : CPlugin { bool LAST_ALLIES = false; public override void OnServerLoad() { ServerPrint("// ====== Created by Tony_M ====== //"); ServerPrint("// ====== Testing by Zoxan and [MEM] SoClose ====== //"); } public bool LastAllies() { int ALLIES = 0, AXIS = 0; ServerClient client = null; for (int i = 0; i < 18; i++) { client = GetClient(i); if (client != null) { if (client.Team == Teams.Allies) { ALLIES++; } else { AXIS++; } } } //(Axis > 4) if (ALLIES == 1 && AXIS > 4) { return true; } return false; } public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage) { if (Attacker.Team == Teams.Allies) { if (LastAllies() && !LAST_ALLIES) { iPrintLnBold("^2" + Attacker.Name + " ^3 !", null); // int WepID = GetWeapon("iw5_mk14_mp"); Attacker.Other.PrimaryWeapon = WepID; Attacker.Other.CurrentWeapon = WepID; Attacker.Ammo.PrimaryAmmoClip = 120; // Attacker.Other.Health += 165; // Attacker.Other.SpeedScale = 1.2f; // LAST_ALLIES = true; } } return Damage; } } }
powered by http://forum.hard-zombie.com/index.php
learn rus
Reply

#5
It isn't created by you. But code is good. Also stop adverstising 'hard' shit.
But at least it is gonna work.


This code will crash, add more statement to check player data.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#6
(09-26-2013, 17:14)SailorMoon Wrote: It isn't created by you. But code is good. Also stop adverstising 'hard' shit.
But at least it is gonna work.

creator i am lol

(09-26-2013, 17:14)SailorMoon Wrote: It isn't created by you. But code is good. Also stop adverstising 'hard' shit.
But at least it is gonna work.


This code will crash, add more statement to check player data.

i am check code, worked 100% normal.
Reply

#7
(09-26-2013, 17:16)[HARD] Tony. Wrote:
(09-26-2013, 17:14)SailorMoon Wrote: It isn't created by you. But code is good. Also stop adverstising 'hard' shit.
But at least it is gonna work.

creator i am lol

(09-26-2013, 17:14)SailorMoon Wrote: It isn't created by you. But code is good. Also stop adverstising 'hard' shit.
But at least it is gonna work.


This code will crash, add more statement to check player data.

i am check code, worked 100% normal.

Play +5 more hours and see.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#8
thankyou all
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#9
Code:
if (client.Team == Teams.Allies) { ALLIES++; } else { AXIS++; } } }
So spectators = axis?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#10
(09-26-2013, 21:17)DidUknowiPwn Wrote:
Code:
if (client.Team == Teams.Allies) { ALLIES++; } else { AXIS++; } } }
So spectators = axis?

How you will reset value? .. You can't do it in loop. Most method: find mw2 gsc code and port it to c# Troll
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.