I actually preferred using these cvars coz they are native to csgo but when using them together with deathmatch i got laggy. The reason I still need Bail DM is for the weapons.
BUT I also tried looking for cvars that would give people random weapon on spawn (because then I don't need to use bailopan DM for anything) but none of them worked.
I also tried making my own script that would give random weapon on spawn
EDIT- BELOW CODE ACTUALLY STARTED WORKING ALL OF THE SUDDEN.
Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#define PLUGIN_VERSION "1.0"
new Handle:rnd_Cvar_Enable = INVALID_HANDLE
new const String:Rifles[][] =
{
"weapon_ak47", "weapon_aug", "weapon_bizon", "weapon_famas", "weapon_g3sg1", "weapon_galilar", "weapon_m249",
"weapon_m4a1", "weapon_mac10", "weapon_mag7", "weapon_mp7", "weapon_mp9", "weapon_negev", "weapon_nova", "weapon_p90", "weapon_sawedoff",
"weapon_scar20", "weapon_sg556", "weapon_ssg08", "weapon_ump45", "weapon_xm1014"
}
new const String:Pistols[][] =
{
"weapon_deagle", "weapon_elite", "weapon_fiveseven", "weapon_p250", "weapon_tec9", "weapon_glock", "weapon_hkp2000"
}
public Plugin:myinfo =
{
name = "Random Weapon On Spawn",
author = "Shitler",
description = "RNDM MOTHERFUCKING WEAPONS",
version = PLUGIN_VERSION,
url = "www.alliedmods.com"
}
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
rnd_Cvar_Enable = CreateConVar("sm_rndweapon_enabled", "1", "Enables or Disables random weapon each spawn");
}
public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (GetConVarInt(rnd_Cvar_Enable) && IsClientInGame(client) && (!IsFakeClient(client)))
{
new Prim = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY);
if(Prim != -1)
RemovePlayerItem(client, Prim);
new Sec = GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY);
if(Sec != -1)
RemovePlayerItem(client, Sec);
GivePlayerItem(client, Rifles[GetRandomInt(0, sizeof(Rifles)-1)]);
GivePlayerItem(client, Pistols[GetRandomInt(0, sizeof(Pistols)-1)]);
}
}