|
Senior Member
Join Date: May 2013
Location: Portugal
|

04-07-2016
, 17:43
[HELP] CSGO Vip Menu
|
#1
|
hi alliedmodders  , i modify this plugin a bit because i wanted like this , i can compile without errors etc but when i enter in game with the plugin instaled on my own server it says: Disconnected by game, can some one help me? [CSGO]
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>
#define VERSION "1.0"
#define SPEC 1
#define TEAM1 2
#define TEAM2 3
new g_VipStatus[MAXPLAYERS+1] = 0;
new Handle:g_Health;
new Handle:g_Money;
new Handle:g_Armor;
public Plugin:myinfo =
{
name = "VIP Plugin",
author = "ITGurra",
description = "Vip Plugin that gives access to gravity and respawn!",
version = "2.0",
url = "http://mywebsite.nothing"
}
public OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn);
CreateConVar("sm_vip_version", VERSION, "VIP Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_Health = CreateConVar("sm_vip_health", "120", "HP On Spawn");
g_Money = CreateConVar("sm_vip_money", "1200", "Money On Spawn");
g_Armor = CreateConVar("sm_vip_armor", "120", "Armor On Spawn");
RegConsoleCmd("sm_vip", VIP);
RegConsoleCmd("sm_vipres", VipRespawn, "VIP Respawn");
AutoExecConfig(true, "sm_vip");
}
public OnClientDisconnect(client)
{
g_VipStatus[client] = 0;
}
public Action:VIP(client, args)
{
if (IsPlayerGenericAdmin(client))
{
new Handle:VMenu = CreateMenu(VipMenu);
SetMenuTitle(VMenu, "[ WWW.STPORTUGAL.COM ]\n.::VIP MENU::.");
AddMenuItem(VMenu, "M4", "Gravity On");
AddMenuItem(VMenu, "AK47", "Gravity Off");
AddMenuItem(VMenu, "AWP", "GRAVITY SOMETHING");
SetMenuExitButton(VMenu, true);
DisplayMenu(VMenu, client, 0);
return Plugin_Handled;
}
else
{
PrintToChat(client, "\x04[ WWW.STPORTUGAL.COM ]\x01 Tu não es \x03VIP\x01.");
return Plugin_Handled;
}
}
public VipMenu(Handle:VMenu, MenuAction:action, client, position)
{
if(action == MenuAction_Select)
{
decl String:item[20];
GetMenuItem(VMenu, position, item, sizeof(item));
if(StrEqual(item, "M4"))
{
GivePlayerItem(client, "CSWeapon_M4A1");
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_flashbang");
GivePlayerItem(client, "weapon_smokegrenade");
GivePlayerItem(client, "weapon_molotov");
return;
}
if(StrEqual(item, "AK47"))
{
GivePlayerItem(client, "CSWeapon_AK47");
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_flashbang");
GivePlayerItem(client, "weapon_smokegrenade");
GivePlayerItem(client, "weapon_molotov");
return;
}
if(StrEqual(item, "AWP"))
{
GivePlayerItem(client, "CSWeapon_AWP");
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_flashbang");
GivePlayerItem(client, "weapon_smokegrenade");
GivePlayerItem(client, "weapon_molotov");
return;
}
}
else if(action == MenuAction_End)
{
CloseHandle(VMenu)
}
}
new g_PlayerRespawn[MAXPLAYERS+1];
public bool:OnClientConnect(client, String:Reject[], Len)
{
if (IsPlayerGenericAdmin(client))
g_PlayerRespawn[client] = 3
else
g_PlayerRespawn[client] = 0;
}
public Action:VipRespawn(client, args)
{
if (IsPlayerGenericAdmin(client))
{
if (g_PlayerRespawn[client] > 0)
{
CS_RespawnPlayer(client);
g_PlayerRespawn[client]--;
}
else
{
PrintToChat(client, "\x04[ WWW.STPORTUGAL.COM ]\x01 Não tens mais \x04respawn's\x01 , espera te ao proximo mapa.");
}
}
}
public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(IsPlayerGenericAdmin(client))
{
SetEntProp(client, Prop_Data, "m_iHealth", GetConVarInt(g_Health));
SetEntProp(client, Prop_Send, "m_iAccount", GetConVarInt(g_Money));
SetEntProp(client, Prop_Send, "m_ArmorValue", GetConVarInt(g_Armor));
}
else
{
return Plugin_Handled;
}
return Plugin_Handled;
}
bool:IsPlayerGenericAdmin(client)
{
return CheckCommandAccess(client, "generic_admin", ADMFLAG_RESERVATION, false);
}
|
|