21.11.2015, 10:37
Hello, i'm trying a script to save the licenses plates, i've took SetVehicleRandomPlate(vehicleid) but doesnt works in .ini files.
registering
saving
login
I want numbers! not letters!
RESULT (in my ini file) :
registering
Код:
format(var, 32, "Plate1=%d\n",PlayerInfo[playerid][pPlate1]);fwrite(hFile, var);
Код:
format(var, 32, "Plate1=%d\n",PlayerInfo[playerid][pPlate1]);fwrite(hFile, var); // on player create vehicle new vehid = GetPlayerVehicleID(playerid); PlayerInfo[playerid][pPlate1] = SetVehicleRandomPlate(vehid);
Код:
if( strcmp( key , "Plate1" , true) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPlate1] = strvalEx( val ); }
Код:
stock GetLetter(number) { new letter[5]; if(number == 1){letter="1";}if(number == 2){letter="2";}if(number == 3){letter="3";}if(number == 4){letter="4";}if(number == 5){letter="5";}if(number == 6){letter="6";}if(number == 7){letter="7";}if(number == 8){letter="8";} if(number == 9){letter="9";}if(number == 10){letter="0";}if(number == 11){letter="K";}if(number == 12){letter="L";}if(number == 13){letter="M";}if(number == 14){letter="N";}if(number == 15){letter="O";}if(number == 16){letter="P";} if(number == 17){letter="Q";}if(number == 18){letter="R";}if(number == 19){letter="S";}if(number == 20){letter="T";}if(number == 21){letter="U";}if(number == 22){letter="V";}if(number == 23){letter="W";}if(number == 24){letter="X";} if(number == 25){letter="Y";}if(number == 26){letter="Z";} return letter; }
Код:
stock SetVehicleRandomPlate(vehicleid) { new letter[4], number[15], plate[15]; letter[0] = random(9)+1; letter[2] = random(9)+1; letter[3] = random(9)+1; new rnumber = random(10); new rnumber2 = random(10); new rnumber3 = random(10); format(number, 15, "%d%d%d", rnumber, rnumber2, rnumber3); format(plate, 15, "%d%d%d%d%d", GetLetter(letter[0]), GetLetter(letter[1]), GetLetter(letter[2]), GetLetter(letter[3]),number); SetVehicleNumberPlate(vehicleid, plate); //VehicleRandomPlate[vehicleid] = plate; //VehicleUsingRandomPlate[vehicleid] = 1; return 1; }
Код:
Plate1=1