This is my code but it has a lot of errors.
What I want is the plugin to remove 2700$ from the person who used the command and give the person an Ak-47, being this a VIP exclusive command.
Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#pragma newdecls required
public Plugin myinfo =
{
name = "",
author = PLUGIN_AUTHOR,
description = "",
version = PLUGIN_VERSION,
url = ""
};
public void OnPluginStart()
{
RegConsoleCmd("sm_ak47", Cmd_Ak47, "VIP AK.");
}
public Action Cmd_Ak47(int client, int args)
{
if(CheckCommandAccess(client, "", ADMFLAG_CUSTOM1, false))
{
ReplyToCommand("\x01[\x09Anubis\x10Community\x01] Vip only command.")
}
if(CheckCommandAccess(client, "", ADMFLAG_CUSTOM1, true))
{
new clientMoney = GetEntProp(client, Prop_Send, "m_iAccount"); // Get player's current cash
if (clientMoney = 2700)
GivePlayerItem(client, "weapon_ak47");
ReplyToCommand("\x01[\x09Anubis\x10Community\x01] Bought an ak -2700$.")
if (clientMoney != 2700)
{
ReplyToCommand("\x01[\x09Anubis\x10Community\x01] No enough money \x01.")
}
}
}