Raised This Month: $ Target: $400
 0% 

what's shield id? help~


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lucky109
Senior Member
Join Date: Jan 2005
Old 05-07-2005 , 16:07   what's shield id? help~
Reply With Quote #1

what's shield id?

Quote:
if(weapon == CSW_SHIELD) {
it's show compile error
"undefined symbol "CSW_SHIELD"
lucky109 is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 05-07-2005 , 16:50  
Reply With Quote #2

it's no weapon so there isnt a CSW_ constant. this might help you: http://forums.alliedmods.net/showthread.php?t=8542
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
lucky109
Senior Member
Join Date: Jan 2005
Old 05-07-2005 , 17:19  
Reply With Quote #3

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");
}

}
lucky109 is offline
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 05-07-2005 , 17:33  
Reply With Quote #4

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.
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 05-07-2005 , 21:41  
Reply With Quote #5

sheilds are weapon_sheild as an entity. it does work.
__________________
Plugins:
none

n0obie4life is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-07-2005 , 21:47  
Reply With Quote #6

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

That should help you, A LOT.

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)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
lucky109
Senior Member
Join Date: Jan 2005
Old 05-08-2005 , 02:00  
Reply With Quote #7

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
lucky109 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2005 , 02:28  
Reply With Quote #8

Try the code that I showed you..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 16:48.


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