SetVehicleNumberPlate
#7

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Not all vehicles should come with such number.

There is a problem with in the code! What i think is we need the char datatype to step out here. Let me think for a while. Ill post you a new code.

You know what wait! Try this its an edit of your original code: I want to know what do you get when you do this.

pawn Код:
new const NumeriuRaides[] =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   new const NumeriuSkaiciai[] =    "0123456789";

    new string[6],msg[10];
     string[0] = NumeriuRaides[random(sizeof(NumeriuRaides))];
    string[1] = NumeriuRaides[random(sizeof(NumeriuRaides))];
    string[2] = NumeriuRaides[random(sizeof(NumeriuRaides))];
    string[3] = NumeriuSkaiciai[random(sizeof(NumeriuSkaiciai))];
    string[4] = NumeriuSkaiciai[random(sizeof(NumeriuSkaiciai))];
    string[5] = NumeriuSkaiciai[random(sizeof(NumeriuSkaiciai))];
    format(msg,8,"%s%s%s:%d%d%d",string[0],string[1],string[2],string[3],string[4],string[5]);
    format(tInfo[nuomTransp][Numeriai],8,"%s",msg);
    SetVehicleNumberPlate(nuomTransp,tInfo[nuomTransp][Numeriai]);
    SetVehicleToRespawn(nuomTransp);
I think you will be having sscanf , click here if you want to download it..

I made this code to use it with sscanf. Try this too:

pawn Код:
new const NumeriuRaides[] =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   new const NumeriuSkaiciai[] =    "0123456789";

    new string[6],msg[10];
    new randletter = random(sizeof(NumeriuRaides));
    new randdigit = random(sizeof(NumeriuSkaiciai));
    sscanf(NumeriuRaides[randletter], "s[1]", string[0]);
    sscanf(NumeriuRaides[randletter], "s[1]", string[1]);
    sscanf(NumeriuRaides[randletter], "s[1]", string[2]);
    sscanf(NumeriuRaides[randdigit], "s[1]", string[3]);
    sscanf(NumeriuRaides[randdigit], "s[1]", string[4]);
    sscanf(NumeriuRaides[randdigit], "s[1]", string[5]);
    format(msg,8,"%s%s%s:%d%d%d",string[0],string[1],string[2],string[3],string[4],string[5]);
    format(tInfo[nuomTransp][Numeriai],8,"%s",msg);
    SetVehicleNumberPlate(nuomTransp,tInfo[nuomTransp][Numeriai]);
    SetVehicleToRespawn(nuomTransp);
[13:11:56] sscanf warning: String buffer overflow.
[13:11:56] sscanf warning: String buffer overflow....
Reply


Messages In This Thread
SetVehicleNumberPlate - by elvinas02 - 25.11.2012, 08:59
Re: SetVehicleNumberPlate - by Ballu Miaa - 25.11.2012, 09:08
Re: SetVehicleNumberPlate - by elvinas02 - 25.11.2012, 09:13
Re: SetVehicleNumberPlate - by Ballu Miaa - 25.11.2012, 09:17
Re: SetVehicleNumberPlate - by elvinas02 - 25.11.2012, 09:28
Re: SetVehicleNumberPlate - by Ballu Miaa - 25.11.2012, 09:39
Re: SetVehicleNumberPlate - by elvinas02 - 25.11.2012, 09:55
Re: SetVehicleNumberPlate - by Ballu Miaa - 25.11.2012, 09:57
Re: SetVehicleNumberPlate - by elvinas02 - 25.11.2012, 09:59
Re: SetVehicleNumberPlate - by Ballu Miaa - 25.11.2012, 10:58

Forum Jump:


Users browsing this thread: 2 Guest(s)