SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 27/08/2009, 02:01 PM   #1
RSX
Huge Clucker
 
RSX's Avatar
 
Join Date: Dec 2007
Location: GMT+2
Posts: 338
Reputation: 4
Default What is bool vs 32 bit new?

Ok, I for long time didn't use bool (i didn't really know what it is) and, so i remember, that i have saw in keys using about like this:
if(keys&KEY_WHATEVER)
So by having each key other number 2*2 (i don't know how it spells in english, maybe power) it allows to have 2 or more keys pressed working in time.
Last i want to say is that bool is 7 bit in ram, new is 32 bit, bool limits are 1 or 0, new limits are 2147483647, bool is faster but, can hold one 0 or 1,
new is slower, but can hold 31 0 or 1, so it's in right using is like 31 bool variables.
Here you can see my fast cmd that shows the usement of this:
new cmd[256];
new idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "/NT", true) ==0)
{
tmp=strtok(cmdtext, idx);
new thevar=strval(tmp);
new trs[128];
format(trs,128,"Binary : %b", thevar);
SendClientMessage(playerid,0xFFFFFFFF,trs);
new multi2=1;
for(new k;k<31;k++)
{
if(thevar&multi2)
{
format(trs,128,"Bit Offset : %d, Decimal Offset : %d, IS 1", k, multi2);
SendClientMessage(playerid,0xFFFFFFFF,trs);
}
else
{
format(trs,128,"Bit Offset : %d, Decimal Offset : %d, IS 0", k, multi2);
SendClientMessage(playerid,0xFFFFFFFF,trs);
}
multi2=multi2*2;
}
return 1;
}
So i want your knowledge about this? And what you think about this?
__________________
HACKED PAWN MEMORY
Log for OXP+ Precompiler :
Done making basic operations... Up next : Finishing basic class {} framework Up next 2 : Making basic rewrite to destination Up next 3 : Making destination options.
RSX is offline  
Old 28/08/2009, 08:07 AM   #2
RSX
Huge Clucker
 
RSX's Avatar
 
Join Date: Dec 2007
Location: GMT+2
Posts: 338
Reputation: 4
Default Re: What is bool vs 32 bit new?

Hey why noone says nothing?!
__________________
HACKED PAWN MEMORY
Log for OXP+ Precompiler :
Done making basic operations... Up next : Finishing basic class {} framework Up next 2 : Making basic rewrite to destination Up next 3 : Making destination options.
RSX is offline  
Old 28/08/2009, 09:53 AM   #3
Zeex
Guest
 
Posts: n/a
Default Re: What is bool vs 32 bit new?

Have you read this topic? These tricks were nicely explained there
 
Old 28/08/2009, 03:43 PM   #4
RSX
Huge Clucker
 
RSX's Avatar
 
Join Date: Dec 2007
Location: GMT+2
Posts: 338
Reputation: 4
Default Re: What is bool vs 32 bit new?

Oh, wHY i didn't know it before i thought this X@, agh....
__________________
HACKED PAWN MEMORY
Log for OXP+ Precompiler :
Done making basic operations... Up next : Finishing basic class {} framework Up next 2 : Making basic rewrite to destination Up next 3 : Making destination options.
RSX is offline  
 

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tag Mismatch ( bool ) UsaBoy91 Help Archive 4 17/12/2009 02:54 PM
Bool MB@ Help Archive 7 28/10/2009 10:18 PM
[Bool problem solved] dini_Float returns 0.0? Remi-X Help Archive 26 02/08/2009 02:04 PM


All times are GMT. The time now is 03:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.