AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   read_data(...) (https://forums.alliedmods.net/showthread.php?t=22943)

Evaldas 01-07-2006 11:32

read_data(...)
 
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 ?

Jordan 01-07-2006 12:03

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

Hawk552 01-07-2006 13:22

http://www.amxmodx.org/funcwiki.php?go=func&id=895

XxAvalanchexX 01-07-2006 13:34

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.


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

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