View Single Post
MatoBoost
Junior Member
Join Date: Apr 2016
Old 04-06-2019 , 10:26   Re: Check if player has grenade/equip on spawn
Reply With Quote #6

Code:
#include <cstrike>
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public Plugin:myinfo = 
{
	name = "Grenade strip VIP",
	author = "MatoBoost",
	description = "Removes grenades at the end of the round for VIP",
	version = "0.1",
	url = "http://games-town.eu"
}

public OnPluginStart(){
}

public OnRoundEnd(Handle:event, const String:name[], bool:dontBroadcast){

	int client = GetClientOfUserId(GetEventInt(event, "userid"))	
	int ent = -1;  
	
	for(int i = 1; i <= MaxClients; i++){
		if(((CheckCommandAccess(client, "", ADMFLAG_RESERVATION)) == 1) && IsClientInGame(i)){
		
			while ((ent = GetPlayerWeaponSlot(client, CS_SLOT_GRENADE)) != -1)
			{
				RemovePlayerItem(client, ent);
				RemoveEntity(ent);
			}
	
		}
	}
}
I've managed to make this plugin, but it does not work properly, it removes grenades only for one player (and sometimes not even that), how do I fix this please ?
MatoBoost is offline