From one string to several integers
#7

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Well I have no clue why you use a string for that if you just could put that in one 32 bit cell (a normal variable in pawn) with bit manipulation

To convert a number from a string you need to subtract the value of '0'
pawn Код:
PInfo[playerid][FoundTiki][ti] = PInfo[playerid][TikiString][ti] - '0';
But if you only use 1 or 0 than you could use a check
pawn Код:
PInfo[playerid][FoundTiki][ti] = (PInfo[playerid][TikiString][ti] == '1');
Thank you very much, this works
Btw what do you mean with store it into a 32-bit cel?
And how would I convert a string into different integers if there were more values than just 0 and 1, let's say 1, 2, 3?

(+Rep btw)
Reply


Messages In This Thread
From one string to several integers - by knackworst - 28.10.2014, 20:10
Re: From one string to several integers - by fordawinzz - 28.10.2014, 20:16
Re: From one string to several integers - by knackworst - 28.10.2014, 20:17
Re: From one string to several integers - by RedFusion - 28.10.2014, 20:22
Re: From one string to several integers - by fordawinzz - 28.10.2014, 20:30
AW: From one string to several integers - by Nero_3D - 28.10.2014, 20:31
Re: AW: From one string to several integers - by knackworst - 28.10.2014, 20:39
AW: Re: AW: From one string to several integers - by Nero_3D - 28.10.2014, 21:16

Forum Jump:


Users browsing this thread: 1 Guest(s)