Re: Bad loads plugins game.data
Okay, but why does the indicated plugin inform about the lack game data
If it works correctly on one of my servers, but it doesn't work on a clean one because of this error
Quote:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "[CS:GO] VIP",
author = "xBonio & Avgariat & Vasto_Lorde",
description = "VIP Generator by cs-plugin.com",
version = "1.0",
url = "http://cs-plugin.com"
};
int offsetFlash;
int offsetHealth;
int g_fLastButtons[MAXPLAYERS+1], g_fLastFlags[MAXPLAYERS+1], g_iJumps[MAXPLAYERS+1];
public void OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn);
HookEvent("player_death", PlayerDeath);
}
public void OnMapStart()
{
int entindex;
entindex = CreateEntityByName("weapon_flashbang");
DispatchSpawn(entindex);
offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
AcceptEntityInput(entindex, "Kill");
entindex = CreateEntityByName("weapon_healthshot");
DispatchSpawn(entindex);
offsetHealth = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
AcceptEntityInput(entindex, "Kill");
}
public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(IsValidPlayer(client) && IsPlayerVIP(client))
{
if(IsPlayerAlive(client))
{
CreateTimer(0.1, GiveEquipment, GetEventInt(event, "userid"), TIMER_FLAG_NO_MAPCHANGE);
}
}
}
public Action GiveEquipment(Handle timer, any userid) {
int client = GetClientOfUserId(userid);
if(!IsPlayerAlive(client) || !IsValidPlayer(client)) return;
if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0 && GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 15)
{
SetEntProp(client, Prop_Send, "m_ArmorValue", 100);
SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth") + 5);
if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1)
GivePlayerItem(client, "weapon_flashbang");
if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHealth) < 1)
GivePlayerItem(client, "weapon_healthshot");
if(GetClientTeam(client) == CS_TEAM_CT)
if(GetClientTeam(client) == CS_TEAM_CT)
if (GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0)
GivePlayerItem(client, "item_defuser");
}
}
public Action PlayerDeath(Handle event, const char[] name, bool dontBroadcast) {
if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0 && GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 15)
{
int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if(!IsValidPlayer(attacker) || !IsPlayerVIP(attacker)) return;
int health = GetClientHealth(attacker);
SetEntityHealth(attacker, health+1);
//int money = GetEntProp(attacker, Prop_Send, "m_iAccount");
//SetEntProp(attacker, Prop_Send, "m_iAccount", money+100);
bool headshot = GetEventBool(event, "headshot", false);
if(headshot)
{
health = GetClientHealth(attacker);
SetEntityHealth(attacker, health+2);
//money = GetEntProp(attacker, Prop_Send, "m_iAccount");
//SetEntProp(attacker, Prop_Send, "m_iAccount", money+100);
}
if(GetClientHealth(attacker) > 105)
SetEntityHealth(attacker, 105);
}
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
if (IsValidPlayer(client) && IsPlayerVIP(client))
{
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;
}
}
stock bool IsValidPlayer(int client)
{
if(client >= 1 && client <= MaxClients && IsClientInGame(client) && IsClientConnected(client) && !IsFakeClient(client) && !IsClientReplay(client) && !IsClientSourceTV(client))
return true;
return false;
}
stock bool IsPlayerVIP(int client)
{
if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
return true;
return false;
}
|
|