Junior Member
|

02-12-2019
, 13:41
Re: problem with this script (remove)
|
#21
|
Quote:
i want add 2flashbang ..2grenade..1smoke... and 1 m4a1 for ct (ak47 for T) in every round (at spawn)
Without manipulating the original script ..how can i do?
|
So where is the problem?
PHP Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "Rowdy"
#define PLUGIN_VERSION "1.03"
#include <sourcemod>
#include <sdktools>
#include <smlib>
#pragma newdecls required
public Plugin myinfo =
{
name = "Replacing Guns?",
author = PLUGIN_AUTHOR,
description = "...",
version = PLUGIN_VERSION,
url = "https://steamcommunity.com/profiles/76561198307962930"
};
public void OnPluginStart()
{
HookEvent("player_spawn", OnPlayerSpawn);
}
public void OnPlayerSpawn(Handle event, char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
ReplaceGuns(client);
}
public void ReplaceGuns(int client) {
int weaponIndex;
char weaponName[64];
if ((weaponIndex = GetPlayerWeaponSlot(client, 1)) != -1) {
if (IsValidEntity(weaponIndex)) {
GetEntityClassname(weaponIndex, weaponName, sizeof(weaponName));
if (StrContains(weaponName, "usp", false) != -1 || StrContains(weaponName, "glock", false) != -1) {
RemovePlayerItem(client, weaponIndex);
AcceptEntityInput(weaponIndex, "Kill");
Client_GiveWeaponAndAmmo(client, "weapon_deagle", true, 90);
}
}
}
int team = GetClientTeam(client);
if(team == 2) {
Client_GiveWeaponAndAmmo(client, "weapon_ak47", true, 90);
Client_GiveWeaponAndAmmo(client, "weapon_knife", true, 1);
Client_GiveWeaponAndAmmo(client, "weapon_hegrenade", true, 2);
Client_GiveWeaponAndAmmo(client, "weapon_flashbang", true, 2);
Client_GiveWeaponAndAmmo(client, "weapon_smokegrenade", true, 1);
} else if (team == 3) {
Client_GiveWeaponAndAmmo(client, "weapon_m4a1", true, 90);
Client_GiveWeaponAndAmmo(client, "weapon_knife", true, 1);
Client_GiveWeaponAndAmmo(client, "weapon_hegrenade", true, 2);
Client_GiveWeaponAndAmmo(client, "weapon_flashbang", true, 2);
Client_GiveWeaponAndAmmo(client, "weapon_smokegrenade", true, 1);
}
}
__________________
 
PHP, MySQL, SM, IPS Apps & Plugins
Last edited by Rowdy4E; 02-12-2019 at 13:43.
|
|