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

Problem z generatorem vip


kzn
 Udostępnij

Rekomendowane odpowiedzi

Witam, mam problem z generatorem vip (tym od mygo.pl). W konsoli nie mam żadnych errorów, gracz nawet po nabyciu flagi CUSTOM_1 ("o") nie dostaje atrybutów, które powinien otrzymać.

 

Kod:


#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#include <scp>

int g_fLastButtons[MAXPLAYERS+1];
int g_fLastFlags[MAXPLAYERS+1];
int g_iJumps[MAXPLAYERS+1];

public Plugin:myinfo = 
{
    name = "VIP Generator",
    author = "mastah7991",
    description = "Automatycznie wygenerowany VIP",
    version = "1.0",
    url = "MYGO.PL"
}

public OnPluginStart()
{
    HookEvent("player_spawn", Event_PlayerSpawn);
    HookEvent("player_death", Event_PlayerDeath);
}


public OnClientPutInServer(client)
{
    if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
    {
        CS_SetClientClanTag(client, "[VIP] ");
        char name[32];
        GetClientName(client,name,31);
        PrintToChatAll("c1.BlackSquad.eu | Gracz VIP %s wszedl na serwer",name);
    }
}

public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "attacker"));
    if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
    {
        SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+120);
        SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+250);
        SetEntityGravity(client, 0.8);
        SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.2);
        GivePlayerItem(client,"weapon_deagle");
    }
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "attacker"));
    bool headshot = GetEventBool(event, "headshot");

    if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
    {
        SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+5);

        if(headshot)
        SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth")+15);

        if(GetEntProp(client, Prop_Send, "m_iHealth")>180)
        SetEntityHealth(client, 180);

        SetEntProp(client, Prop_Send, "m_iAccount",  GetEntProp(client, Prop_Send, "m_iAccount")+100);

        if(headshot)
        SetEntProp(client, Prop_Send, "m_iAccount", GetEntProp(client, Prop_Send, "m_iAccount")+300);
    }
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
    if(IsValidPlayer(client)&&GetUserFlagBits(client)&(1<<ADMFLAG_CUSTOM1))
    {
        int    fCurFlags    = GetEntityFlags(client);    
        int fCurButtons    = GetClientButtons(client);
                    
        if (g_fLastFlags[client] & FL_ONGROUND)
        {        
            if (!(fCurFlags & FL_ONGROUND) &&!(g_fLastButtons[client] & IN_JUMP) &&    fCurButtons & IN_JUMP) 
            {
                g_iJumps[client]++;            
            }
        }
        else if (fCurFlags & FL_ONGROUND)
        {
            g_iJumps[client] = 0;                        
        }
        else if (!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
        {
            if ( 1 <= g_iJumps[client] <= 2)
            {                        
                g_iJumps[client]++;                                            
                float vVel[3];
                GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);    
                                
                vVel[2] = 250.0;
                TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);    
            }                            
        }
                        
        g_fLastFlags[client]    = fCurFlags;                
        g_fLastButtons[client]    = fCurButtons;

        if(buttons & IN_DUCK)
            SetEntityRenderColor(client, 255, 255, 255, 175);
        else
            SetEntityRenderColor(client, 255, 255, 255, 255);
    }

}

public Action:OnChatMessage(&author, Handle:recipients, String:name[], String:message[]) 
{
    if(IsValidPlayer(author)&&GetUserFlagBits(author)&(1<<ADMFLAG_CUSTOM1))
    {
        Format(name, MAXLENGTH_NAME, "%s", name);
        new MaxMessageLength = MAXLENGTH_MESSAGE - strlen(name) - 5; 
        Format(name, MaxMessageLength, " [VIP] %s",name); 
        return Plugin_Changed;
    }
    return Plugin_Continue;
}

stock bool IsValidPlayer(client)
{
    if(client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) )
    return true;

    return false;
}

 

Skompilowalem do *.smx, mam inc.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

×
×
  • Dodaj nową pozycję...