AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what's shield id? help~ (https://forums.alliedmods.net/showthread.php?t=13192)

lucky109 05-07-2005 16:07

what's shield id? help~
 
what's shield id?

Quote:

if(weapon == CSW_SHIELD) {
it's show compile error
"undefined symbol "CSW_SHIELD"

Basic-Master 05-07-2005 16:50

it's no weapon so there isnt a CSW_ constant. this might help you: http://forums.alliedmods.net/showthread.php?t=8542

lucky109 05-07-2005 17:19

Quote:

Originally Posted by Basic-Master
it's no weapon so there isnt a CSW_ constant. this might help you: http://forums.alliedmods.net/showthread.php?t=8542

oh....
then how can i change shield skin?

my scripting is :

Quote:

public plugin_precache() {
precache_model("models/test/p_shield.mdl");
}

public event_curweapon(id) {

new clip, ammo, weapon = get_user_weapon(id,clip,ammo);

if(weapon == CSW_SHIELD) {
entity_set_string(id,EV_SZ_weaponmodel,"model s/test/p_shield.mdl");
}

}

Basic-Master 05-07-2005 17:33

okay, try this:
Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <fun> #define OFFSET_SHIELD    510 #define OFFSET_SHIELD_AMD64    559 //AMXX team forgot to put this in core.inc //returns true if server is amd64 native is_amd64_server(); public plugin_precache() {     precache_model("models/test/p_shield.mdl"); } public plugin_modules(){     require_module("fakemeta");     require_module("fun"); } public cs_user_has_shield( id ){     new shieldFlag;     if ( is_amd64_server() ) shieldFlag = get_pdata_int(id, OFFSET_SHIELD_AMD64, 0);         else shieldFlag = get_pdata_int(id, OFFSET_SHIELD);             return (shieldFlag & (1<<24)); } public event_curweapon(id) {     if (cs_user_has_shield(id))         entity_set_string(id,EV_SZ_weaponmodel,"models/test/p_shield.mdl"); }

works only when fakemeta, engine and fun modules are added to modules.ini.

n0obie4life 05-07-2005 21:41

sheilds are weapon_sheild as an entity. it does work.

v3x 05-07-2005 21:47

http://forums.alliedmods.net/showthread.php?p=59531

That should help you, A LOT. :D

Here, I'll put it here plain and simple:
Code:
#include <amxmodx> #include <engine> public plugin_init() {     // ..     register_clcmd("say /shield","check_shield",-1) } public check_shield() {     new id = read_data(2)     new seq = entity_get_int(id,EV_INT_sequence)     if(seq == 98) {         client_print(id,3,"You have a shield")     }     return PLUGIN_HANDLED }

Code:

    //SEQUENCCE 89 = Shield + Knife
    //SEQUENCE 94 = Shield + Pistol
    //SEQUENCE 98 = Shield only (right clicked)


lucky109 05-08-2005 02:00

Quote:

Originally Posted by Basic-Master
okay, try this:
Code:
#include <amxmodx> #include <fakemeta> #include <engine> #include <fun> #define OFFSET_SHIELD    510 #define OFFSET_SHIELD_AMD64    559 //AMXX team forgot to put this in core.inc //returns true if server is amd64 native is_amd64_server(); public plugin_precache() {     precache_model("models/test/p_shield.mdl"); } public plugin_modules(){     require_module("fakemeta");     require_module("fun"); } public cs_user_has_shield( id ){     new shieldFlag;     if ( is_amd64_server() ) shieldFlag = get_pdata_int(id, OFFSET_SHIELD_AMD64, 0);         else shieldFlag = get_pdata_int(id, OFFSET_SHIELD);             return (shieldFlag & (1<<24)); } public event_curweapon(id) {     if (cs_user_has_shield(id))         entity_set_string(id,EV_SZ_weaponmodel,"models/test/p_shield.mdl"); }

works only when fakemeta, engine and fun modules are added to modules.ini.

doesn't work :cry:

v3x 05-08-2005 02:28

Try the code that I showed you..


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

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