Number ALWAYS needs to start with 666 -
Jochemd - 27.11.2010
Hello,
Im sorry, my second problem for today which is pretty weird. I want a phone number to start with 666, like in the real San Francisco. So, I tried this:
The GetFreeNumber function does not matter now. The only problem is: this just the value GetFreeNumber returns his value (the phone number without 666, so for example: 768

.
When I seperate the thingy by '666 %i' it gives: '666 0'. Weird?
So: how can I just let it return as: 6667688?
Regards, Jochem
Note: code was deleted, problem fixed.
Re: Number ALWAYS needs to start with 666 -
RSX - 27.11.2010
format(string,sizeof(string),"666%i",GetFreeNumber (playerid));
SendClientMessageToAll(COLOR_GREEN,string);
This gives only the GetFreeNumber return as far as i understood?
Re: Number ALWAYS needs to start with 666 -
Jochemd - 27.11.2010
Yea, you're right.
Re: Number ALWAYS needs to start with 666 -
Zh3r0 - 27.11.2010
pawn Код:
new string[50],
SixSixSix = 666;
format(string,sizeof(string),"%d%d",SixSixSix,GetFreeNumber(playerid));
SendClientMessageToAll(COLOR_GREEN,string);
Try now.
Re: Number ALWAYS needs to start with 666 -
Jochemd - 27.11.2010
Just returns 6660.
Re: Number ALWAYS needs to start with 666 -
Zh3r0 - 27.11.2010
Quote:
Originally Posted by Jochemd
Just returns 6660.
|
Then change %d%d to %d%i i guess %i it's the right format.
Re: Number ALWAYS needs to start with 666 -
Jochemd - 27.11.2010
It is the same, isn't it? And it returns just 6660 again :S
Re: Number ALWAYS needs to start with 666 -
Cypog - 27.11.2010
if there is a 0, you're GetFreeNumber is not working.
Replace GetFreeNumber with a random number to prove it (But not zero

)
Re: Number ALWAYS needs to start with 666 -
RSX - 27.11.2010
Try only GetFreeNumber... maybe it now returns 0 You could also try something complexer, making possible numbers with 6660003 for example.
Re: Number ALWAYS needs to start with 666 -
Jochemd - 28.11.2010
It can't return 0.