SA-MP Forums Archive
Phone number problem.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Phone number problem.. (/showthread.php?tid=468188)



Phone number problem.. - Scrillex - 07.10.2013

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.


Re : Phone number problem.. - FayR - 07.10.2013

PhoneNummber[11].

[playerid][PhoneNummber][0] etc?


Re: Phone number problem.. - EiresJason - 07.10.2013

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;



Re: Phone number problem.. - Scrillex - 07.10.2013

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

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


Re: Phone number problem.. - Pottus - 07.10.2013

#define MAX_PHONE_NUMBER_LENGTH

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


Re: Phone number problem.. - Scrillex - 07.10.2013

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

(Like a small code)


Re: Phone number problem.. - EiresJason - 07.10.2013

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 ) );



Re: Phone number problem.. - Scrillex - 07.10.2013

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


Re: Phone number problem.. - EiresJason - 07.10.2013

Np


Re: Phone number problem.. - [ABK]Antonio - 07.10.2013

You know you have 7 randoms but 6 %d right