Raised This Month: $ Target: $400
 0% 

read_data(...)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Evaldas
Member
Join Date: Jul 2005
Location: Lithuania
Old 01-07-2006 , 11:32   read_data(...)
Reply With Quote #1

Code:
public check_shield(id)     {     new user = read_data(0);     new shield_status = read_data(1);         if (shield_status == 64)         {         client_print(user, print_center, "maxspeed 125, gravity 1.5")         set_user_maxspeed(user, 125.0)         set_user_gravity(user, 1.5)     }     else if (shield_status == 0)         {         client_print(user, print_center, "maxspeed 250, gravity 1.0")         set_user_maxspeed(user, 250.0)         set_user_gravity(user, 1.25)     }     else     {         return PLUGIN_CONTINUE     } }

How do programer know, that read_data(1) == 64 is shield. I mean, is there any manual or something where I could read about ?
__________________
Evaldas is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 01-07-2006 , 12:03  
Reply With Quote #2

I think you can do:

Code:
if (user_has_weapon(id, shield)

Although I'm not sure of the constant for shield --- in game it's just shield but it could be like: CSW_TACTICAL
Jordan is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-07-2006 , 13:22  
Reply With Quote #3

http://www.amxmodx.org/funcwiki.php?go=func&id=895
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-07-2006 , 13:34  
Reply With Quote #4

Way to misread his post. Go home.

Evaldas, like all other discoveries, it's done mostly through trial and error and observation. When a message is received you read out all of the data and examine it. Eventually you notice that one piece of information is this when they have a shield out, but it's that if they don't.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

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:07.


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