pin generator pin
#1

i make generator system, but dont working, im try all metods, but dont working, error.

its generator for admin pin

Код:
public CreateStaffPin(targetid)
{
            new Symb1 = random(sizeof(StaffPinGen)),
                Symb2 = random(sizeof(StaffPinGen)),
                Symb3 = random(sizeof(StaffPinGen)),
                Symb4 = random(sizeof(StaffPinGen)),
                Symb5 = random(sizeof(StaffPinGen)),
                Symb6 = random(sizeof(StaffPinGen));

                format(staffpincod, 64,"%s%s%s%s%s%s", StaffPinGen[Symb1],StaffPinGen[Symb2],StaffPinGen[Symb3],StaffPinGen[Symb4],StaffPinGen[Symb5],StaffPinGen[Symb6]);
                PlayerInfo[targetid][pStaffPin] = staffpincod;
}
Reply
#2

Shouldn't this be integers, since your are getting 6 random numbers, not characters?
pawn Код:
format(staffpincod, 64,"%d%d%d%d%d%d"
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
Shouldn't this be integers, since your are getting 6 random numbers, not characters?
pawn Код:
format(staffpincod, 64,"%d%d%d%d%d%d"
oh god, i dont see xD thanks , rep+
Reply
#4

again error. lool

Код:
public CreateStaffPin(targetid)
{
            new Symb1 = random(sizeof(StaffPinGen)),
                Symb2 = random(sizeof(StaffPinGen)),
                Symb3 = random(sizeof(StaffPinGen)),
                Symb4 = random(sizeof(StaffPinGen)),
                Symb5 = random(sizeof(StaffPinGen)),
                Symb6 = random(sizeof(StaffPinGen));

                format(createstaffcod[targetid], 64,"%d%d%d%d%d%d", StaffPinGen[Symb1],StaffPinGen[Symb2],StaffPinGen[Symb3],StaffPinGen[Symb4],StaffPinGen[Symb5],StaffPinGen[Symb6]);
                PlayerInfo[targetid][pStaffPin] = createstaffcod[targetid];
                
}
Reply
#5

What are you trying to do? Pin with numbers or something more complicated? Show me definition of createstaffcod, pStaffPin and StaffPinGen.
Reply
#6

fixed. i find problem. lock
Reply
#7

Or you could just do, you know
pawn Код:
new code = 100000 + random(900000);
Then you'll realize how ridiculous above code looks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)