Raised This Month: $51 Target: $400
 12% 

[CS:GO] Last player of a team ?


Post New Thread Reply   
 
Thread Tools Display Modes
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 12-19-2015 , 21:15   Re: [CS:GO] Last player of a team ?
Reply With Quote #11

WUT ?

Tell me please what exactly do you want.. I will do it for you.. ... cannot belive my eyes....
ESK0 is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-20-2015 , 04:32   Re: [CS:GO] Last player of a team ?
Reply With Quote #12

Quote:
Originally Posted by ESK0 View Post
WUT ?

Tell me please what exactly do you want.. I will do it for you.. ... cannot belive my eyes....
I need to check last man's team...
undefined symbol "client"

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define PLUGIN_VERSION "X"
#define MAX_FILE_LEN 80

public Plugin:myinfo 
{
    
name "Privat",
    
author "Mado",
    
description "none",
    
version PLUGIN_VERSION,
    
url "."
};

public 
OnPluginStart()
{
    
HookEvent("player_death"EventPlayerDeath);
}

public 
EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victimId GetEventInt(event"userid");

    new 
victimClient GetClientOfUserId(victimId);

    new 
killedTeam GetClientTeam(victimClient);

    new 
playersConnected GetMaxClients();

    new 
lastManId 0;
    for (new 
1playersConnectedi++)
    {
        if(
IsClientInGame(i))
        {
            if(
killedTeam==GetClientTeam(i) && IsPlayerAlive(i))
            {
                if(
lastManId)
                {
                    
lastManId = -1;
                } else {
                    
lastManId i;
                }
            }
        }
    }

    if(
lastManId 0)
    {
        new 
String:clientname[64];
        
GetClientName(lastManIdclientnamesizeof(clientname));
        if(
GetClientTeam(client) == CS_TEAM_T)     // HERE undefined symbol "client"
        
{
            
PrintHintTextToAll("<font color='#ff0000'><b>%s is now a Survivor!</b></font>"clientname);
        }
        if(
GetClientTeam(client) == CS_TEAM_CT)   // SAME HERE.
        
{
            
PrintHintTextToAll("<font color='#0000ff'><b>%s is now a Survivor!</b></font>"clientname);
        }
    }


__________________

Last edited by valio_skull; 12-20-2015 at 04:36.
valio_skull is offline
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 12-20-2015 , 07:34   Re: [CS:GO] Last player of a team ?
Reply With Quote #13

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_death"EventPlayerDeath);
}

public 
EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int lastClientclientCount;
    for (
int i 1MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
lastClient i;
            
clientCount++;
        }
    }

    if (
clientCount == 1)
    {
        if(
GetClientTeam(lastClient) == CS_TEAM_T)
        {
            
PrintHintTextToAll("<font color='#ff0000'><b>%N is now a Survivor!</b></font>"lastClient);
        }
        if(
GetClientTeam(lastClient) == CS_TEAM_CT)
        {
            
PrintHintTextToAll("<font color='#0000ff'><b>%N is now a Survivor!</b></font>"lastClient);
        }
    }

lingzhidiyu is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 12-20-2015 , 09:05   Re: [CS:GO] Last player of a team ?
Reply With Quote #14

Quote:
Originally Posted by valio_skull View Post
I need to check last man's team...
undefined symbol "client"

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define PLUGIN_VERSION "X"
#define MAX_FILE_LEN 80

public Plugin:myinfo 
{
    
name "Privat",
    
author "Mado",
    
description "none",
    
version PLUGIN_VERSION,
    
url "."
};

public 
OnPluginStart()
{
    
HookEvent("player_death"EventPlayerDeath);
}

public 
EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victimId GetEventInt(event"userid");

    new 
victimClient GetClientOfUserId(victimId);

    new 
killedTeam GetClientTeam(victimClient);

    new 
playersConnected GetMaxClients();

    new 
lastManId 0;
    for (new 
1playersConnectedi++)
    {
        if(
IsClientInGame(i))
        {
            if(
killedTeam==GetClientTeam(i) && IsPlayerAlive(i))
            {
                if(
lastManId)
                {
                    
lastManId = -1;
                } else {
                    
lastManId i;
                }
            }
        }
    }

    if(
lastManId 0)
    {
        new 
String:clientname[64];
        
GetClientName(lastManIdclientnamesizeof(clientname));
        if(
GetClientTeam(client) == CS_TEAM_T)     // HERE undefined symbol "client"
        
{
            
PrintHintTextToAll("<font color='#ff0000'><b>%s is now a Survivor!</b></font>"clientname);
        }
        if(
GetClientTeam(client) == CS_TEAM_CT)   // SAME HERE.
        
{
            
PrintHintTextToAll("<font color='#0000ff'><b>%s is now a Survivor!</b></font>"clientname);
        }
    }


Last man of specific team or together ?
ESK0 is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-20-2015 , 09:53   Re: [CS:GO] Last player of a team ?
Reply With Quote #15

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <clientprefs>
#include <sdktools>
#include <sdkhooks>

#pragma semicolon 1

#define PLUGIN_VERSION "X"
#define MAX_FILE_LEN 80

new Handle:cvarAmount;

public 
Plugin:myinfo 
{
    
name "Privat",
    
author "Mado",
    
description "none",
    
version PLUGIN_VERSION,
    
url "."
};

public 
OnPluginStart()
{
    
cvarAmount CreateConVar("sm_survivor_maxhp""400""Survivor's MAX health"FCVAR_PLUGINtrue1.0false_);
    
HookEvent("player_death"EventPlayerDeath);
}

public 
OnMapStart()
{
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/belt.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/belt.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/belt_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/eyes.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/eyes.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/gloves.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/gloves.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/gloves_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hands.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hands.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hands_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hair.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hair.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/hair_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/head_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/magnum.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/magnum.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/magnum_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/pants.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/pants.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/pants_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shirt.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shirt.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shirt_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shoes.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shoes.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/shoes_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/upperbody.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/upperbody.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/walkingdead/rickgrimes/upperbody_n.vtf");

    
AddFileToDownloadsTable("models/player/custom_player/walkingdead/rickgrimes/rick_v2.dx90.vtx");
    
AddFileToDownloadsTable("models/player/custom_player/walkingdead/rickgrimes/rick_v2.mdl");
    
AddFileToDownloadsTable("models/player/custom_player/walkingdead/rickgrimes/rick_v2.phy");
    
AddFileToDownloadsTable("models/player/custom_player/walkingdead/rickgrimes/rick_v2.vvd");

    
PrecacheModel("models/player/custom_player/walkingdead/rickgrimes/rick_v2.mdl");

    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/body.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/body.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/body_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/body_s.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/hat.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/hat.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/hat_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/hat_s.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/head.vmt");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/head.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/head_n.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/head_s.vtf");
    
AddFileToDownloadsTable("materials/models/player/custom_player/zombie/revenant/head_glow.vtf");

    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_v2.mdl");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_v2.dx90.vtx");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_v2.phy");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_v2.vvd");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_arms.mdl");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_arms.dx90.vtx");
    
AddFileToDownloadsTable("models/player/custom_player/zombie/revenant/revenant_arms.vvd");

    
PrecacheModel("models/player/custom_player/zombie/revenant/revenant_v2.mdl");
}

public 
EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
victimId GetEventInt(event"userid");

    new 
victimClient GetClientOfUserId(victimId);

    new 
killedTeam GetClientTeam(victimClient);

    new 
playersConnected GetMaxClients();

    new 
lastManId 0;
    for (new 
1playersConnectedi++)
    {
        if(
IsClientInGame(i))
        {
            if(
killedTeam==GetClientTeam(i) && IsPlayerAlive(i))
            {
                if(
lastManId)
                {
                    
lastManId = -1;
                } else
                {
                    
lastManId i;
                }
            }
        }
    }

    if(
lastManId 0)
    {
        new 
String:clientname[64];
        
GetClientName(lastManIdclientnamesizeof(clientname));
        new 
MaxHealth GetConVarInt(cvarAmount);
        
SetEntData(lastManIdFindDataMapOffs(lastManId"m_iMaxHealth"), MaxHealth4true);
        
SetEntData(lastManIdFindDataMapOffs(lastManId"m_iHealth"), MaxHealth4true);
        
SetEntityHealth(lastManId400);
        if(
GetClientTeam(lastManId) == CS_TEAM_T)
        {
            
PrintHintTextToAll("<font color='#ff0000'><b>%s is now Kage!</b></font>"clientname);
            
SetEntityModel(lastManId"models/player/custom_player/zombie/revenant/revenant_v2.mdl");
            
SetEntProp(lastManIdProp_Send"m_ArmorValue"1004);
            
SetEntProp(lastManIdProp_Send"m_bHasHelmet"1);
            
SetEntityGravity(lastManId0.3);
            
SetEntPropFloat(lastManIdProp_Data"m_flLaggedMovementValue"2.5);
        }
        if(
GetClientTeam(lastManId) == CS_TEAM_CT)
        {
            
PrintHintTextToAll("<font color='#00ffff'><b>%s is now Psycho!</b></font>"clientname);
            
SetEntityModel(lastManId"models/player/custom_player/walkingdead/rickgrimes/rick_v2.mdl");
            
SetEntProp(lastManIdProp_Send"m_ArmorValue"1004);
            
SetEntityGravity(lastManId0.6);
            
SetEntPropFloat(lastManIdProp_Data"m_flLaggedMovementValue"1.6);
            
ClientCommand(lastManId"drop");
            
ClientCommand(lastManId"drop");
            
FakeClientCommand(lastManId"drop");
            
FakeClientCommand(lastManId"drop");
            
GivePlayerItem(lastManId"weapon_xm1014");
            
CreateTimer(0.5Timer_Weapon_TIMER_DATA_HNDL_CLOSE);
        }
    }
}

public 
Action:Timer_Weapon(Handle:TimerlastManId)
{
    
GivePlayerItem(lastManId"weapon_xm1014");

THAT'S IT, FINALLY, I DID IT.
MOM, GET THE CAMERA :*

Edit: I can't force the CT to drop the weapon and pick XM1014...
and the model doesn't work for T, but it's ok...
Edit#2: I removed T model and I used stock StripAllWeapons(lastManId) to remove current weapons and then give XM1014
__________________

Last edited by valio_skull; 12-20-2015 at 10:36.
valio_skull is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode