AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   i want to force survivor to buy this extra item.. (https://forums.alliedmods.net/showthread.php?t=113090)

L|c0000000ol- 12-23-2009 11:10

i want to force survivor to buy this extra item..
 
HTML Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <xs>

new g_norecoil[33]
new Float: cl_pushangle[33][3]
new g_maxplayers

const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)

public plugin_init()
{
    register_plugin("[ZP] Extra Item: No Recoil", "0.1.0", "fezh")
    new weapon_name[24]
    for (new i = 1; i <= 30; i++)
    {
        if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23))
        {
            RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Pre")
            RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Post", 1)
        }
    }
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
        zp_get_user_survivor(i++)
    g_maxplayers = get_maxplayers()
}

public zp_user_infected_post(id)
    g_norecoil[id] = false

public client_connect(id)
    g_norecoil[id] = false

public event_round_start()
    for (new id = 1; id <= g_maxplayers; id++)
        g_norecoil[id] = false

public fw_Weapon_PrimaryAttack_Pre(entity)
{
    new id = pev(entity, pev_owner)

    if (g_norecoil[id])
    {
        pev(id, pev_punchangle, cl_pushangle[id])
        return HAM_IGNORED;
    }
    return HAM_IGNORED;
}

public fw_Weapon_PrimaryAttack_Post(entity)
{
    new id = pev(entity, pev_owner)

    if (g_norecoil[id])
    {
        new Float: push[3]
        pev(id, pev_punchangle, push)
        xs_vec_sub(push, cl_pushangle[id], push)
        xs_vec_mul_scalar(push, 0.0, push)
        xs_vec_add(push, cl_pushangle[id], push)
        set_pev(id, pev_punchangle, push)
        return HAM_IGNORED;
    }
    return HAM_IGNORED;
}

public zp_force_buy_extra_item(id, g_norecoil, 1)

ima failure.. pls someone help me.. i want to force the survivor to buy this item

Doc-Holiday 12-23-2009 13:54

Re: i want to force survivor to buy this extra item..
 
use the php /php tags so its color coded

Exolent[jNr] 12-23-2009 13:58

Re: i want to force survivor to buy this extra item..
 
Quote:

Originally Posted by NcB_Sav (Post 1028561)
use the php /php tags so its color coded

That isn't necessary.
As long as code is posted in php/code/small/pawn tags and it isn't too long to stretch the page in small/pawn tags then it's fine.
The only situation in which code should be posted differently is if it is posted straight into the post or if it is in quote tags without and code-style tags.

Doc-Holiday 12-24-2009 00:45

Re: i want to force survivor to buy this extra item..
 
Quote:

Originally Posted by Exolent[jNr] (Post 1028569)
That isn't necessary.
As long as code is posted in php/code/small/pawn tags and it isn't too long to stretch the page in small/pawn tags then it's fine.
The only situation in which code should be posted differently is if it is posted straight into the post or if it is in quote tags without and code-style tags.


posting using small or php is easier to read which makes people more likly to help


All times are GMT -4. The time now is 04:16.

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