AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some [Question to ask] !!!! (https://forums.alliedmods.net/showthread.php?t=95609)

--kml-- 06-25-2009 09:31

Some [Question to ask] !!!!
 
Some question to ask

1.) how to make my own include? is it for shortening code?
like making a stock inside it .

2) Well , i have read a tutorial about bitsum operator so do i realy need to make bitsum_is_user_alive ?

3) So , How to check if a player is lagging or loosing fps?

4) how to spawn a sprite like the HP sprite ( is it a sprite?)
means by if i move the sprite still is sticking it to the screen and not lagging .


i will ask more if i am not sure about something :)

and thx if u help :)

:crab::crab::crab:

--kml-- 06-25-2009 22:02

Re: Some [Question to ask] !!!!
 
Small bump O.o

fysiks 06-25-2009 22:35

Re: Some [Question to ask] !!!!
 
Quote:

Originally Posted by --kml-- (Post 856698)
Some question to ask

1.) how to make my own include? is it for shortening code?
like making a stock inside it .

2) Well , i have read a tutorial about bitsum operator so do i realy need to make bitsum_is_user_alive ?

3) So , How to check if a player is lagging or loosing fps?

4) how to spawn a sprite like the HP sprite ( is it a sprite?)
means by if i move the sprite still is sticking it to the screen and not lagging .


i will ask more if i am not sure about something :)

and thx if u help :)

:crab::crab::crab:


1) Put stuff in a <filename>.inc file and then put "#include <filename>" (with angle brackets this time lol).
2) You obviously didn't understand that tutorial. Use something like this:

PHP Code:

new bitsum_is_alive

// Set whether or not they are alive:

if( is_user_alive(id) )
{
    
bitsum_is_alive |= (1<<id)
}
else
{
    
bitsum_is_alive &=  ~(1<<id)
}

// Then use the following to check and see if they are alive:

if (bistum_is_alive & (1<<id)) 
{
    
// User is alive.


3) Why?

--kml-- 06-25-2009 22:42

Re: Some [Question to ask] !!!!
 
1) (with angle brackets this time lol). i already know how to include files just to make 1 O.o

2) what i meant is bitsum is an operator? if i dont put bitsum_ it will not work?

( and i try to read it many times and try to absorp it like what arkshine said but still dont understand much of it :mrgreen: ( i even print the tutorial and bring it with me lol))

3) Well if a player lag i can give them an option whether they want to refresh or not ( plugin ) and if he lag his name will be sent to a file (LOG) so that i know how many people lag ( and for some other use )
An example :
a player lag
server detects it
sends a log to server
and if too many people lag
there will be some cmd on lowing the graphic like
limiting the decals , sprites and some other things.
( just an example )


4) and for this how?

thx for helping :mrgreen:

:crab::crab::crab:

fysiks 06-25-2009 22:53

Re: Some [Question to ask] !!!!
 
No, it's not a function or operator. Bitsum = A sum of bits.

PHP Code:

new what_ever_you_want_to_name_this_variable  

// Set whether or not they are alive:  

if( is_user_alive(id) )  
{  
    
what_ever_you_want_to_name_this_variable |= (1<<id)  
}  
else  
{  
    
what_ever_you_want_to_name_this_variable &=  ~(1<<id)  
}  

// Then use the following to check and see if they are alive:  

if (what_ever_you_want_to_name_this_variable & (1<<id))   
{  
    
// User is alive.  



--kml-- 06-25-2009 23:03

Re: Some [Question to ask] !!!!
 
PHP Code:

if (bistum_is_alive & (1<<id))   
{  
    
// User is alive.  


do i realy have to put bitsum? O.o

fysiks 06-25-2009 23:08

Re: Some [Question to ask] !!!!
 
No.

--kml-- 06-25-2009 23:19

Re: Some [Question to ask] !!!!
 
But u use bistum?
ehhh typo O.o

so i can also use

if ( blablabla_is_alive & (1<<id))?

fysiks 06-25-2009 23:31

Re: Some [Question to ask] !!!!
 
Oh, crap, sorry, that was a mistake (my replace all didn't work completely apparently). Fixed

--kml-- 06-25-2009 23:41

Re: Some [Question to ask] !!!!
 
ooo

thx :D

but how for 4)?


All times are GMT -4. The time now is 15:31.

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