Harsh USSR ☭
Участник
- Сообщения
- 104
- Реакции
- 2
а шприцы как добавлять?
//------------------------------------------------------------------------------
// GPL LISENCE (short)
//------------------------------------------------------------------------------
/*
* Copyright (c) 2014 R1KO
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <vip_core>
public Plugin:myinfo =
{
name = "[VIP] Tagrenade",
author = "R1KO (skype: vova.andrienko1)",
version = "1.0.0"
};
new const String:g_sFeature[] = "Tagrenade";
new bool:AlreadyHaveTagrenade[MAXPLAYERS+1];
public void OnPluginStart(){
HookEvent("round_end", Event_RoundEnd);
}
public VIP_OnVIPLoaded(){
VIP_RegisterFeature(g_sFeature, BOOL);
VIP_HookClientSpawn(OnPlayerSpawn);
}
public OnPlayerSpawn(iClient, iTeam, bool:bIsVIP){
if(bIsVIP && VIP_IsClientFeatureUse(iClient, g_sFeature))
{
CreateTimer(1.0, Timer_Callout, iClient);
}
}
public Action Timer_Callout(Handle timer, any iClient){
if(!AlreadyHaveTagrenade[iClient]){
GivePlayerItem(iClient, "weapon_tagrenade");
AlreadyHaveTagrenade[iClient] = true;
}
}
public Action Event_RoundEnd(Handle event, const char[] name, bool dontBroadcast){
for (int i = 1; i <= MaxClients; i++){
if (IsClientInGame(i)){
AlreadyHaveTagrenade[i] = false;
}
}
}
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <vip_core>
public OnClientPutInServer(iClient)
{
SDKHook(iClient, SDKHook_WeaponCanUse, OnWeaponCanUse);
}
public Action:OnWeaponCanUse(iClient, iWeapon)
{
if(VIP_IsClientVIP(iClient) == false)
{
decl String:sWeapon[32];
GetEdictClassname(iWeapon, sWeapon, sizeof(sWeapon));
if(strcmp(sWeapon[7], "healthshot") == 0 || strcmp(sWeapon[7], "tagrenade") == 0)
{
return Plugin_Handled;
}
}
return Plugin_Continue;
}
Исправлена повторная выдача гранаты.
P.S. Спасибо @komashchenko
Пользователь R1KO обновил ресурс [VIP] Tagrenade новой записью:
Обновление
Узнать больше об этом обновлении...