Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[TF2] Give addcond effect to a player who calls "MEDIC"


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hi. It is my first post here. I am making a request since I have very poor knowledge on writing plugins.

Just like the title stated, I am looking for a simple plugin, that gives "addcond 55" for 0.1 second, to a player when he/she does a "voicemenu 0 0" command, which is the "calling for medic" command.

From what I know, I can use AddCommandListener(OnVoiceMenu, "voicemenu");

I found a plugin by Tylerst, which can give addcond effects. It seems to be a good reference.

PHP Code:

#include <tf2>

public Plugin:myinfo =
{
    
name "TF2 Add Condition",
    
author "Tylerst",
    
description "Add a condition to the target(s)",
    
version "1.0.0",
    
url "None"
}

public 
OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
RegAdminCmd("sm_addcond"Command_AddConditionADMFLAG_GENERIC"Add a condition to the target(s), Usage: sm_addcond "target" "condition number" "duration"");
    
RegAdminCmd("sm_removecond"Command_RemoveConditionADMFLAG_GENERIC"Add a condition to the target(s), Usage: sm_removecond "target" "condition number"");
}

public 
Action:Command_AddCondition(clientargs)
{

    if(
args != 3)
    {
        
ReplyToCommand(client"[SM] Usage: sm_addcond "target" "condition number" "duration"");
        return 
Plugin_Handled;
    }

    new 
String:strBuffer[MAX_NAME_LENGTH], String:target_name[MAX_TARGET_LENGTH], target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
GetCmdArg(1strBuffersizeof(strBuffer));
    if ((
target_count ProcessTargetString(strBufferclienttarget_listMAXPLAYERSCOMMAND_FILTER_ALIVEtarget_namesizeof(target_name), tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }

    new 
iConditionFloat:flDuration;

    
GetCmdArg(2strBuffersizeof(strBuffer));
    
iCondition StringToInt(strBuffer);

    
GetCmdArg(3strBuffersizeof(strBuffer));
    
flDuration StringToFloat(strBuffer);    

    for(new 
0target_counti++)
    {
        
TF2_AddCondition(target_list[i], TFCond:iConditionflDuration);
    }
    return 
Plugin_Handled;
}

public 
Action:Command_RemoveCondition(clientargs)
{

    if(
args != 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_removecond "target" "condition number"");
        return 
Plugin_Handled;
    }

    new 
String:strBuffer[MAX_NAME_LENGTH], String:target_name[MAX_TARGET_LENGTH], target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
GetCmdArg(1strBuffersizeof(strBuffer));
    if ((
target_count ProcessTargetString(strBufferclienttarget_listMAXPLAYERSCOMMAND_FILTER_ALIVEtarget_namesizeof(target_name), tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }

    new 
iCondition;

    
GetCmdArg(2strBuffersizeof(strBuffer));
    
iCondition StringToInt(strBuffer);

    for(new 
0target_counti++)
    {
        
TF2_RemoveCondition(target_list[i], TFCond:iCondition);
    }
    return 
Plugin_Handled;


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...