AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [DELETED] (https://forums.alliedmods.net/showthread.php?t=309872)

Shadowless 08-10-2018 07:54

[DELETED]
 
---

OciXCrom 08-10-2018 16:11

Re: [help] golden m4
 
#include engine

Celena Luna 08-14-2018 03:07

Re: [help] golden m4
 
Code:

public fw_SetModel(entity, model[])
{
    if(!is_valid_ent(entity))
        return FMRES_IGNORED

    if(!g_HasM4[id])
        return FMRES_IGNORED


    if(!equali(model, OLD_M4_W_MODEL))
        return FMRES_IGNORED

    new className[33]
    entity_get_string(entity, EV_SZ_classname, className, 32)
   
    if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
    {
        engfunc(EngFunc_SetModel, entity, M4_W_MODEL)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}

Need to check if the owner have M4 Gold first

Ghosted 08-15-2018 14:45

Re: [help] golden m4
 
Yes that won't work, part of code for W model is missing even if you detect PlayerIndex & g_HasM4 it wont still work, cause dropped weapon requires key. I would suggest my weapon mod.

Celena Luna 08-16-2018 05:54

Re: [help] golden m4
 
Quote:

Originally Posted by Shadowless (Post 2610337)
//// GoldenM4a1.sma
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\G oldenM4a1.sma(121) : error 017: undefined symbol "id"
//
// 1 Error.
// Could not locate output file compiled\GoldenM4a1.amx (compile failed).
//
// Compilation Time: 0,3 sec
// ----------------------------------------


line 121 = if(!g_HasM4[id])

Code:

public fw_SetModel(entity, model[])
{
    if(!is_valid_ent(entity))
        return FMRES_IGNORED

    static id; id = pev(entity, pev_owner)

    if(!g_HasM4[id])
        return FMRES_IGNORED


    if(!equali(model, OLD_M4_W_MODEL))
        return FMRES_IGNORED

    new className[33]
    entity_get_string(entity, EV_SZ_classname, className, 32)
   
    if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
    {
        engfunc(EngFunc_SetModel, entity, M4_W_MODEL)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}

Quote:

Originally Posted by Ghosted (Post 2610356)
Yes that won't work, part of code for W model is missing even if you detect PlayerIndex & g_HasM4 it wont still work, cause dropped weapon requires key. I would suggest my weapon mod.

Who said it won't work?

Ghosted 08-16-2018 05:59

Re: [help] golden m4
 
Quote:

Originally Posted by Celena Luna (Post 2610472)
Who said it won't work?

I haven't seen code fully, g_HasM4 should work but your code wont cause weaponbox has not owner :crab:

Celena Luna 08-16-2018 06:10

Re: [help] golden m4
 
Quote:

Originally Posted by Ghosted (Post 2610473)
I haven't seen code fully, g_HasM4 should work but your code wont cause weaponbox has not owner :crab:

PHP Code:

/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "Test Code"
#define VERSION "1.0"
#define AUTHOR  "Celena Luna"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_SetModel"fw_SetModel")
}

public 
fw_SetModel(entitymodel[])
{
    if(!
pev_valid(entity))
        return 
FMRES_IGNORED

    
static Classname[32]
    
pev(entitypev_classnameClassnamesizeof(Classname))

    if(!
equal(Classname"weaponbox"))
        return 
FMRES_IGNORED

    
static idname[32]
    
id pev(entitypev_owner)
    
get_user_name(idnamecharsmax(name))
    
client_print(idprint_console"Models: %s"model)
    
client_print(idprint_console"Owner: %i"id)
    
client_print(idprint_console"Owner: %s"name)

    return 
FMRES_IGNORED;


https://i.imgur.com/0F7VxWI.png

Is this enough?

Ghosted 08-16-2018 06:22

Re: [help] golden m4
 
Omg, hows that, weaponbox with owner:crab:... nice ze map tho

Celena Luna 08-16-2018 06:26

Re: [help] golden m4
 
Quote:

Originally Posted by Ghosted (Post 2610481)
Omg, hows that, weaponbox with owner:crab:... nice ze map tho

I wrote CSO weapon to CS 1.6. Isn't that one of important thing when writing a weapon plugins?
plus this is known for long ago.
P/S: Skyline CSO map btw

Ghosted 08-16-2018 06:29

Re: [help] golden m4
 
Quote:

Originally Posted by Celena Luna (Post 2610483)
I wrote CSO weapon to CS 1.6.

O yea, i wrote weapon mod :bacon!: :bacon!: :oops:

Quote:

Originally Posted by Celena Luna (Post 2610483)
P/S: Skyline CSO map btw

Y, i was playing in Nexon


All times are GMT -4. The time now is 11:36.

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