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

[CS:S/CS:GO] SM_Hosties (v2.2.0, 2015-08-15)


Post New Thread Reply   
 
Thread Tools Display Modes
namine
SourceMod Donor
Join Date: Jul 2010
Old 01-29-2011 , 12:56   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #661

Ok, but the SetEntityRenderColor does not appear in the plugin, sm_skinapp.
http://forums.alliedmods.net/showthread.php?p=1010859
That is what I'm using, so how can I fix that?
namine is offline
dataviruset
AlliedModders Donor
Join Date: Feb 2009
Location: Hong Kong
Old 01-29-2011 , 13:19   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #662

Quote:
Originally Posted by namine View Post
Ok, but the SetEntityRenderColor does not appear in the plugin, sm_skinapp.
http://forums.alliedmods.net/showthread.php?p=1010859
That is what I'm using, so how can I fix that?
I don't know where in the code of that plugin the interference is caused, but try disabling that plugin and see if it helps.
dataviruset is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 01-29-2011 , 13:30   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #663

Hey dataviruset,

I finished the basic race game and incorporated it into your Last Request portion of Hosties.

The trigger_* entities I wanted to use were all brush entities and so I couldn't use these so instead there's just a timer that checks how close each player is to the end point.

Also, some things I hadn't coded yet: a count-down to when race will begin (similar to the no-scope only players would be frozen during this time), stripping knives from race contestants, and adding translation support to the race PrintToChatAll statements.

PHP Code:
// Global vars
new Float:gV_StartRaceLocation[3];
new 
Float:gV_EndRaceLocation[3]; 
PHP Code:
// ConVar-stuff
new Handle:sm_hosties_lr_race_enable         INVALID_HANDLE
OnPluginStart()
PHP Code:
    sm_hosties_lr_race_enable CreateConVar("sm_hosties_lr_race_enable""1""Enable or disable race option in last request"); 
OnConfigsExecuted()
PHP Code:
    if (GetConVarInt(sm_hosties_lr_race_enable) == 1)
        
PushArrayCell(LRsenabled10); 
Command_LastRequest
PHP Code:
                                if (GetConVarInt(sm_hosties_lr_race_enable) == 1)
                                {
                                    
decl String:lr_race[32];
                                    
Format(lr_racesizeof(lr_race), "%T""Race"client);
                                    
AddMenuItem(menu"race"lr_race);
                                } 
Inside MainHandler, added (param2 == 10) to the larger IF statement
and this inside that:
PHP Code:
                        else if (param2 == 10)
                        {
                            
// create menu for T to choose start point
                            
new Handle:racemenu1 CreateMenu(RaceStartPointHandler);
                            
SetMenuTitle(racemenu1"Find a Starting Location");
                            
AddMenuItem(racemenu1"startloc""Use current position");
                            
SetMenuExitButton(racemenu1true);
                            
DisplayMenu(racemenu1param1MENU_TIME_FOREVER);
                        } 
MainPlayerHandler
PHP Code:
                                            case 10:
                                            {
                                                
Format(lrnamesizeof(lrname), "%T""Race"LRplayers[param2]);
                                            } 
Inside LaunchLR()
PHP Code:
        case 10:        // race option
        
{
            
//  teleport both players to the start of the race
            
TeleportEntity(LRprogressplayer1gV_StartRaceLocationNULL_VECTORNULL_VECTOR);
            
TeleportEntity(LRprogressplayer2gV_StartRaceLocationNULL_VECTORNULL_VECTOR);
            
PrintToChatAll("\x03[V] \x01Race begins NOW!");
            
            
// make timer to check the race winner
            
CreateTimer(0.1Timer_Race_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        } 
PHP Code:
public RaceEndPointHandler(Handle:menuMenuAction:actionparam1param2)
{
    if (
action == MenuAction_Select)
    {
        if (!
LRblock)
        {
            if (!
LRinprogress)
            {
                if (
IsPlayerAlive(param1) && (GetClientTeam(param1) == CS_TEAM_T))
                {
                    
// use this location
                    
GetClientAbsOrigin(param1gV_EndRaceLocation);
                    
gV_EndRaceLocation[2] += 10;

                    
TE_SetupBeamRingPoint(gV_EndRaceLocation100.0130.0BeamSpriteHaloSprite01530.07.00.0redColor10);
                    
TE_SendToAll();
                    
                    
// allow them to choose a player finally
                    
CreateMainPlayerHandler(param1);
                }
                else
                    
PrintToChat(param1MESS"Not Alive Or In Wrong Team");
            }
            else
                
PrintToChat(param1MESS"Too Slow Another LR In Progress");
        }
        else
            
PrintToChat(param1MESS"LR Not Available");
    }
    else if (
action == MenuAction_End)
        
CloseHandle(menu);
}

public 
RaceStartPointHandler(Handle:menuMenuAction:actionparam1param2)
{
    if (
action == MenuAction_Select)
    {
        if (!
LRblock)
        {
            if (!
LRinprogress)
            {
                if (
IsPlayerAlive(param1) && (GetClientTeam(param1) == CS_TEAM_T))
                {
                    
// use this location
                    
GetClientAbsOrigin(param1gV_StartRaceLocation);
                    
gV_StartRaceLocation[2] += 10;

                    
TE_SetupBeamRingPoint(gV_StartRaceLocation100.0130.0BeamSpriteHaloSprite01530.07.00.0greyColor10);
                    
TE_SendToAll();
                    
                    
CreateRaceEndPointMenu(param1);
                }
                else
                    
PrintToChat(param1MESS"Not Alive Or In Wrong Team");
            }
            else
                
PrintToChat(param1MESS"Too Slow Another LR In Progress");
        }
        else
            
PrintToChat(param1MESS"LR Not Available");
    }
    else if (
action == MenuAction_End)
        
CloseHandle(menu);
}

CreateRaceEndPointMenu(client)
{
    new 
Handle:EndPointMenu CreateMenu(RaceEndPointHandler);
    
SetMenuTitle(EndPointMenu"Choose an End Point");
    
AddMenuItem(EndPointMenu"endpoint""Use Current Position");
    
SetMenuExitButton(EndPointMenutrue);
    
DisplayMenu(EndPointMenuclientMENU_TIME_FOREVER);
}

public 
Action:Timer_Race(Handle:timer)
{
    if ( (!
IsClientInGame(LRprogressplayer1)) || (!IsPlayerAlive(LRprogressplayer1))
      || (!
IsClientInGame(LRprogressplayer2)) || (!IsPlayerAlive(LRprogressplayer2)) )
    {
        return 
Plugin_Stop;
    }

    new 
Float:LRPlayer1Position[3];
    new 
Float:LRPlayer2Position[3];

    
GetClientAbsOrigin(LRprogressplayer1LRPlayer1Position);
    
GetClientAbsOrigin(LRprogressplayer2LRPlayer2Position);
    
// check if how close they are to the end point
    
decl Float:distancePlayer1;
    
decl Float:distancePlayer2;    
    
distancePlayer1 GetVectorDistance(LRPlayer1PositiongV_EndRaceLocationfalse);
    
distancePlayer2 GetVectorDistance(LRPlayer2PositiongV_EndRaceLocationfalse);
    
    
// the order dictates we give ties to the terrorist
    // add a photo-finish random call later if they're both within the amount
    
if (distancePlayer1 Float:130.0)
    {
        
ForcePlayerSuicide(LRprogressplayer2);
        
PrintToChatAll("\x03[V] \x01%N has won the race!"LRprogressplayer1);
        return 
Plugin_Stop;
    }
    else if (
distancePlayer2 Float:130.0)
    {
        
ForcePlayerSuicide(LRprogressplayer1);
        
PrintToChatAll("\x03[V] \x01%N has won the race!"LRprogressplayer2);
        return 
Plugin_Stop;
    }

    return 
Plugin_Continue;


Last edited by databomb; 01-29-2011 at 13:34.
databomb is offline
dataviruset
AlliedModders Donor
Join Date: Feb 2009
Location: Hong Kong
Old 01-29-2011 , 13:57   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #664

Quote:
Originally Posted by databomb View Post
Hey dataviruset,
I finished the basic race game and incorporated it into your Last Request portion of Hosties.
Oh... That must have taken some time. A million thanks to you for sharing code!
dataviruset is offline
Groger
Veteran Member
Join Date: Oct 2009
Location: Belgium
Old 01-29-2011 , 14:42   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #665

Thx a million times databomb, but whene I tried to compile this:
PHP Code:
  if (GetConVarInt(sm_hosties_lr_race_enable) == 1)
        
PushArrayCell(LRsenabled10); 
it says its a loose indentation , i probably just copy pasted the code in the wrong places

Could you give a pre release of this? (sourcecode)
Groger is offline
dataviruset
AlliedModders Donor
Join Date: Feb 2009
Location: Hong Kong
Old 01-29-2011 , 15:27   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #666

My code is indented with tabs, so don't use spaces.
dataviruset is offline
Groger
Veteran Member
Join Date: Oct 2009
Location: Belgium
Old 01-29-2011 , 15:49   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #667

Okay, any plans on incorporating this datavirus?
Groger is offline
dataviruset
AlliedModders Donor
Join Date: Feb 2009
Location: Hong Kong
Old 01-29-2011 , 16:32   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #668

Quote:
Originally Posted by Groger View Post
Okay, any plans on incorporating this datavirus?
Of course, but I'm having hardware difficulties at the moment, so I can't develop very well. And, I have a bit much in school right now.
dataviruset is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 01-29-2011 , 16:55   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #669

Quote:
Originally Posted by dataviruset View Post
Oh... That must have taken some time. A million thanks to you for sharing code!
and many upset players as I fixed the bugs but nearly all the code that's there is copied from your NS menu handling, so it'd be pretty bad if I didn't post back.

Groger, I'd release to you my sp but unfortunately I branched dataviruset's plugin awhile ago and cut out everything but the last request, so it wouldn't be much use to many others.

After play testing this on the server we found a few tweaks here and there.. this is the updated version with a countdown to start the race and weapon stripping. Also, to run this you need to edit your hosties translation file and add in there:

PHP Code:
        "Race"
        
{
                
"en"            "Race"
        

Here is the new code:
maybe this is a ConVar later..
PHP Code:
// Global vars
new g_iRaceCountdown
Inside LaunchLR()
PHP Code:
        case 10:        // race option
        
{
            
StripAllWeapons(LRprogressplayer1);
            
StripAllWeapons(LRprogressplayer2);
            
            
SetEntityMoveType(LRprogressplayer1MOVETYPE_NONE);
            
SetEntityMoveType(LRprogressplayer2MOVETYPE_NONE);
            
            
//  teleport both players to the start of the race
            
TeleportEntity(LRprogressplayer1gV_StartRaceLocationNULL_VECTORNULL_VECTOR);
            
TeleportEntity(LRprogressplayer2gV_StartRaceLocationNULL_VECTORNULL_VECTOR);
            
            
g_iRaceCountdown 3;
            
// fire timer for race begin countdown
            
CreateTimer(1.0Timer_RaceCountDown_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        } 
anywhere else:
PHP Code:
public RaceEndPointHandler(Handle:menuMenuAction:actionparam1param2)
{
    if (
action == MenuAction_Select)
    {
        if (!
LRblock)
        {
            if (!
LRinprogress)
            {
                if (
IsPlayerAlive(param1) && (GetClientTeam(param1) == CS_TEAM_T))
                {
                    
// use this location
                    
GetClientAbsOrigin(param1gV_EndRaceLocation);
                    
gV_EndRaceLocation[2] += 10;

                    
TE_SetupBeamRingPoint(gV_EndRaceLocation100.0130.0BeamSpriteHaloSprite01530.07.00.0greenColor10);
                    
TE_SendToAll();
                    
                    
// allow them to choose a player finally
                    
CreateMainPlayerHandler(param1);
                }
                else
                    
PrintToChat(param1MESS"Not Alive Or In Wrong Team");
            }
            else
                
PrintToChat(param1MESS"Too Slow Another LR In Progress");
        }
        else
            
PrintToChat(param1MESS"LR Not Available");
    }
    else if (
action == MenuAction_End)
        
CloseHandle(menu);
}

public 
RaceStartPointHandler(Handle:menuMenuAction:actionparam1param2)
{
    if (
action == MenuAction_Select)
    {
        if (!
LRblock)
        {
            if (!
LRinprogress)
            {
                if (
IsPlayerAlive(param1) && (GetClientTeam(param1) == CS_TEAM_T))
                {
                    
// use this location
                    
GetClientAbsOrigin(param1gV_StartRaceLocation);
                    
gV_StartRaceLocation[2] += 10;

                    
TE_SetupBeamRingPoint(gV_StartRaceLocation100.0130.0BeamSpriteHaloSprite01530.07.00.0yellowColor10);
                    
TE_SendToAll();
                    
                    
CreateRaceEndPointMenu(param1);
                }
                else
                    
PrintToChat(param1MESS"Not Alive Or In Wrong Team");
            }
            else
                
PrintToChat(param1MESS"Too Slow Another LR In Progress");
        }
        else
            
PrintToChat(param1MESS"LR Not Available");
    }
    else if (
action == MenuAction_End)
        
CloseHandle(menu);
}

CreateRaceEndPointMenu(client)
{
    new 
Handle:EndPointMenu CreateMenu(RaceEndPointHandler);
    
SetMenuTitle(EndPointMenu"Choose an End Point");
    
AddMenuItem(EndPointMenu"endpoint""Use Current Position");
    
SetMenuExitButton(EndPointMenutrue);
    
DisplayMenu(EndPointMenuclientMENU_TIME_FOREVER);
}

public 
Action:Timer_RaceCountDown(Handle:timer)
{
    if ( (!
IsClientInGame(LRprogressplayer1)) || (!IsPlayerAlive(LRprogressplayer1))
      || (!
IsClientInGame(LRprogressplayer2)) || (!IsPlayerAlive(LRprogressplayer2)) )
    {
        return 
Plugin_Stop;
    }
    
    if (
g_iRaceCountdown 0)
    {
        
PrintCenterTextAll("Race begins in %i..."g_iRaceCountdown);
        
g_iRaceCountdown--;
    }
    else
    {
        
PrintCenterTextAll("Go!");

        
SetEntityMoveType(LRprogressplayer1MOVETYPE_WALK);
        
SetEntityMoveType(LRprogressplayer2MOVETYPE_WALK);
        
// make timer to check the race winner
        
CreateTimer(0.1Timer_Race_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;
}

public 
Action:Timer_Race(Handle:timer)
{
    if ( (!
IsClientInGame(LRprogressplayer1)) || (!IsPlayerAlive(LRprogressplayer1))
      || (!
IsClientInGame(LRprogressplayer2)) || (!IsPlayerAlive(LRprogressplayer2)) )
    {
        return 
Plugin_Stop;
    }

    new 
Float:LRPlayer1Position[3];
    new 
Float:LRPlayer2Position[3];

    
GetClientAbsOrigin(LRprogressplayer1LRPlayer1Position);
    
GetClientAbsOrigin(LRprogressplayer2LRPlayer2Position);
    
// check if how close they are to the end point
    
decl Float:distancePlayer1;
    
decl Float:distancePlayer2;    
    
distancePlayer1 GetVectorDistance(LRPlayer1PositiongV_EndRaceLocationfalse);
    
distancePlayer2 GetVectorDistance(LRPlayer2PositiongV_EndRaceLocationfalse);
    
    
// the order dictates we give ties to the terrorist
    // add a photo-finish random call later if they're both within the amount
    
if (distancePlayer1 Float:75.0)
    {
        
ForcePlayerSuicide(LRprogressplayer2);
        
PrintToChatAll("\x03[V] \x01%N has won the race!"LRprogressplayer1);
        return 
Plugin_Stop;
    }
    else if (
distancePlayer2 Float:75.0)
    {
        
ForcePlayerSuicide(LRprogressplayer1);
        
PrintToChatAll("\x03[V] \x01%N has won the race!"LRprogressplayer2);
        return 
Plugin_Stop;
    }

    return 
Plugin_Continue;

edit: forgot to mention you need to add this at the top, preferably next to the other colors
PHP Code:
new greenColor[] = {1525515255}; 

Last edited by databomb; 01-29-2011 at 17:01. Reason: forgot to add color
databomb is offline
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 01-29-2011 , 19:58   Re: [CSS] SM_Hosties (v1.11)
Reply With Quote #670

I have a problem. When a CT kills a lot of TT gets slay. My Settings:
sm_hosties_freekill_notify "0"
sm_hosties_freekill_punishment "0"
sm_hosties_freekill_punishment "0"
pTu 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 16:21.


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