AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CS:GO] Give zeus to a certain flag (https://forums.alliedmods.net/showthread.php?t=330402)

lemmon_cs 02-02-2021 00:58

[CS:GO] Give zeus to a certain flag
 
I need this plugin , If i player has flag CUSTOM1 he will get a free zeus every spawn , thanks.

FAQU 02-02-2021 11:46

Re: [CS:GO] Give zeus to a certain flag
 
PHP Code:

#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (
CheckCommandAccess(client""ADMFLAG_CUSTOM1true))
    {
        
GivePlayerItem(client"weapon_taser");
    }



lemmon_cs 02-03-2021 00:36

Re: [CS:GO] Give zeus to a certain flag
 
Not working.

FAQU 02-03-2021 03:49

Re: [CS:GO] Give zeus to a certain flag
 
Quote:

Originally Posted by lemmon_cs (Post 2735537)
Not working.

Working fine on my end. Just make sure the player has the flag.

FurYXO 03-11-2021 15:05

Re: [CS:GO] Give zeus to a certain flag
 
Code:

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    name = "Zeus for Custom1",
    description = "Zeus for Custom1",
    author = "Ervin",
    version = "1.0.0",
    url = "www.magyarhns.hu"
};

public void OnPluginStart()
{
    HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
}

public void Event_PlayerSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
    int userid = hEvent.GetInt("userid");
   
    if (IsClientInGame(GetClientOfUserId(userid)))
    {
        CreateTimer(0.3, Timer_Delay, userid, TIMER_FLAG_NO_MAPCHANGE);
    }
}

public Action Timer_Delay(Handle hTimer, int userid)
{
    int client = GetClientOfUserId(userid);

    if(IsClientInGame(client) && CheckCommandAccess(client, "faszarc", ADMFLAG_CUSTOM1))
    {
        switch (GetClientTeam(client))
        {
            case 2:
            {
                GivePlayerItem(client, "weapon_taser");
            }
            case 3:
            {
                GivePlayerItem(client, "weapon_taser");
            }
        }
    }
}



All times are GMT -4. The time now is 03:37.

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