Phone number problem..
#1

Hello dear samp users .

Thank you for reading my post but i need help again.. Idk why i got that error...

Saving
pawn Код:
enum
PhoneNummber[11]
Error line:
pawn Код:
format(PlayerInfo[playerid][PhoneNummber], sizeof(PlayerInfo[playerid][PhoneNummber]), "044d%d%d%d%d%d%d", random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ) );
Error:
pawn Код:
error 001: expected token: "]", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
 error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Thank You for your time.

Sincerely Scrillex.
Reply
#2

PhoneNummber[11].

[playerid][PhoneNummber][0] etc?
Reply
#3

Try this:
pawn Код:
new phoneno[11];
    format(phoneno, sizeof(phoneno), "044d%d%d%d%d%d%d", random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ) );
    PlayerInfo[playerid][PhoneNumber] = phoneno;
Reply
#4

Not really there is a prob because worked for me this one:

format(PlayerInfo[playerid][Scars], 128, "%s", inputtext);
Reply
#5

#define MAX_PHONE_NUMBER_LENGTH

You can't use sizeof() like that you will need to specify the array size.
Reply
#6

So could you give me some little thing how I could use it right with #define MAX_PHONE_NUMBER_LENGTH..

(Like a small code)
Reply
#7

pawn Код:
format(PlayerInfo[playerid][PhoneNummber], MAX_PHONE_NUMBER_LENGTH, "044d%d%d%d%d%d%d", random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ), random( 10 ) );
Reply
#8

uhh all what i needed was look one dialog behind.. LOL made.. everything big thanks mates +rep for all of you who tried to help me
Reply
#9

Np
Reply
#10

You know you have 7 randoms but 6 %d right
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)