Raised This Month: $ Target: $400
 0% 

[HELP] CSGO Vip Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 04-07-2016 , 17:43   [HELP] CSGO Vip Menu
Reply With Quote #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(clientargs)
{
    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(VMenutrue);
        
DisplayMenu(VMenuclient0);
        
        return 
Plugin_Handled;
    }
    else
    {
        
PrintToChat(client"\x04[ WWW.STPORTUGAL.COM ]\x01 Tu não es \x03VIP\x01.");
        return 
Plugin_Handled;
    }
}

public 
VipMenu(Handle:VMenuMenuAction:actionclientposition)
{
    if(
action == MenuAction_Select)
    {
        
decl String:item[20];
        
GetMenuItem(VMenupositionitemsizeof(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(clientString:Reject[], Len)
{
    
    if (
IsPlayerGenericAdmin(client))
        
g_PlayerRespawn[client] = 3
    
else 
    
g_PlayerRespawn[client] = 0;
    
}  

public 
Action:VipRespawn(clientargs)
{
    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(clientProp_Data"m_iHealth"GetConVarInt(g_Health));
        
SetEntProp(clientProp_Send"m_iAccount"GetConVarInt(g_Money));
        
SetEntProp(clientProp_Send"m_ArmorValue"GetConVarInt(g_Armor));
    }
    else
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
bool:IsPlayerGenericAdmin(client)
{
    return 
CheckCommandAccess(client"generic_admin"ADMFLAG_RESERVATIONfalse);

JoaoVieira is offline
 



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 08:01.


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