24.11.2014, 07:12
Ok... so I made it like this
And that only worked for one car (the first in the file)
So I made it like this
Now the server does not load. Can you tell me why?
It stays like this:
But it should be like this:
pawn Код:
public OnVehicleSpawn(vehicleid)
{
new vpinfo[2][19];
new vpstring[256];
new File:file = fopen("vehplates.cfg", io_read);
if(file)
{
fread(file, vpstring);
split(vpstring, vpinfo, '|');
vehicleid = strval(vpinfo[0]);
format(vplate, 64, "%s", vpinfo[1]);
SetVehicleNumberPlate(vehicleid, vplate);
}
return 1;
}
So I made it like this
pawn Код:
#define MAX_VPLATES 256 //top of the script
public OnVehicleSpawn(vehicleid)
{
new vpinfo[2][19];
new vpstring[256];
new File:file = fopen("vehplates.cfg", io_read);
if(file)
{
new vpx = 1;
while(vpx < MAX_VPLATES)
{
fread(file, vpstring);
split(vpstring, vpinfo, '|');
vehicleid = strval(vpinfo[0]);
format(vplate, 64, "%s", vpinfo[1]);
SetVehicleNumberPlate(vehicleid, vplate);
}
vpx++;
}
return 1;
}
It stays like this:
But it should be like this: