Raised This Month: $51 Target: $400
 12% 

[CS:GO]Knife at spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Easy987
Junior Member
Join Date: Jun 2015
Plugin ID:
4723
Plugin Version:
0.3
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 07-09-2015 , 17:35   [CS:GO]Knife at spawn
    Reply With Quote #1

    Hi. I made this sample script for deathrun servers, some deathrun map at spawn doesn't give knife. Now when someone spawned this plugin give them the default knife.
    Attached Files
    File Type: smx startknife.smx (3.9 KB, 531 views)
    File Type: sp Get Plugin or Get Source (startknife.sp - 1589 views - 502 Bytes)

    Last edited by Easy987; 07-10-2015 at 07:11.
    Easy987 is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 07-09-2015 , 17:53   Re: [CS:GO]Knife at spawn
    Reply With Quote #2

    You can attach those files to your thread.
    Snaggle is offline
    Easy987
    Junior Member
    Join Date: Jun 2015
    Old 07-09-2015 , 18:02   Re: [CS:GO]Knife at spawn
    Reply With Quote #3

    Oh yes, i attached files to topic. Thanks.
    Easy987 is offline
    Deven
    AlliedModders Donor
    Join Date: Jun 2009
    Old 07-12-2015 , 20:42   Re: [CS:GO]Knife at spawn
    Reply With Quote #4

    Thanks for this i was having troubles with some csgo surf maps not spawning knifes and the cvar's for default melee wouldn't work either

    Last edited by Deven; 07-12-2015 at 20:42.
    Deven is offline
    GingeMinge
    New Member
    Join Date: Jul 2015
    Old 07-13-2015 , 19:24   Re: [CS:GO]Knife at spawn
    Reply With Quote #5

    Will it not throw an error if they already have a knife? Added a check and rewritten in the new syntax
    Code:
    #include <sourcemod>
    #include <sdktools>
    
    #pragma semicolon 1
    #pragma newdecls required
    
    public Plugin myinfo = 
    {
    	name = "Auto Knife at Spawn",
    	author = "Easy987",
    	description = "Automatically give knife at spawn.",
    	version = "0.3",
    	url = "http://www.nincswebem.com"
    }
    
    public void OnPluginStart()
    {
    	HookEvent("player_spawn", SpawnEvent);
    }
    
    public Action SpawnEvent(Handle event,const char[] name, bool dontBroadcast)
    {
    	int client = GetClientOfUserId(GetEventInt(event, "userid"));
    	if (GetPlayerWeaponSlot(client, 2) == -1)
    	{
    		GivePlayerItem(client, "weapon_knife");
    	}
    }
    GingeMinge is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 23:44.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode