Easy, but not working
#1

Код:
        Phonenumber = random(89999);
  	format(stri, sizeof(stri), "444%i", Phonenumber);
   	printf("Phone NR: %i", stri);
But it prints only 444, not this random too.
Reply
#2

what is the arraysize of stri?

This forum requires that you wait 60 seconds between posts. Please try again in 21 seconds.
FFS
Reply
#3

Код:
new
      stri[225]
;
Reply
#4

Correct me if i'm wrong but I think this has something to do with the stuff like %s and %d where u use the letters for a variable value like format(blablabla. "You slapped %s", GetName( playerid ). Know what I mean? I think the %i has no defined value like GetName for %s
Reply
#5

You do not need a sting size of 255. Use something like 100. 255 is a waste.
Reply
#6

Got it. But still, why this isnt working ?
Reply
#7

you need a phonenumber of 8 chars long rite?

Код:
	new stri[100];
	format(stri, sizeof(stri), "Your Phonenumber 444");
	for(new i;i<5;i++)
	{
	    format(stri,sizeof(stri),"%s%i",stri,random(10));
	}
   	printf("%s", stri);
Reply
#8

And someone who know Mysql well, how can I select from players database, that if there is already this kind of random number, then it will do new number and insert into database ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)