problem with numberplate
#1

I added to the script a numberplate system. It saves, it loads. It works fine, but when I park a car with a plate, automatically the next car in cfg takes the model 0.
Let me give you an example:
-when there's no plate
Код:
451,562.765991,-1266.859375,16.947799,103.814399,1,0,Dealership,Turismo,300000,,0,999,0
541,545.343078,-1267.061401,16.868099,220.281204,1,0,Dealership,Bullet,300000,,0,999,0
-when it is
Код:
415,550.669860,-1276.274658,17.003257,16.076038,1,0,Craig_Jones,Cheetah,275000,,1,999,plate
0,1870.015380,-1073.184448,23.378593,329.885406,1,0,Craig_Jones,Super GT,225000,,1,999,0
PS: I use GTARP
Reply
#2

Anyone?
Reply
#3

I tried a shorter plate and it works. The question is why?
Reply
#4

Because GTARP has the string limit, you need edit the limit. (Car System)
Reply
#5

Where's that string limit?
Reply
#6

I solved the problem. It doesn't alterate the next car, but now the only problem is that it saves just 8 chars. I type "LS-96-MRK" and it shows LS-96-MR.
The codes are:
Код:
cPlate[16], at CarInfo
The cmd is:
Код:
if (strcmp(cmd, "/changeplate", true, 12)==0)
	{
	    cmd = strtok(cmdtext, idx);
		if(!strlen(cmd))
		{
	        SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [numar. foloseste '-' pentru spatiu]");
			return 1;
	    }
   		if(IsPlayerInAnyVehicle(playerid) == 1)
		{
            if(!IsACop(playerid))
	        {
	            SendClientMessage(playerid, COLOR_GREY, " Nu esti politist!");
	            return 1;
	        }
		   SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd);
		   new vehid=GetPlayerVehicleID(playerid);
		   strmid(CarInfo[vehid][cPlate], cmd, 0, 16, strlen(cmd));
		   SetVehicleToRespawn(vehid);
		   SendClientMessage(playerid, 0xFF9900AA, "Numar schimbat!");
		   new Float:x;
		   new Float:y;
		   new Float:z;
		   GetPlayerPos(playerid, x, y, z);
		   SetVehiclePos(vehid, x+5, y, z);
		   return 1;
		}
				else
				{
				    SendClientMessage(playerid, 0xFF9900AA, "Nu esti intr-o masina.");
				}
	    return 1;
	}
At LoadCar()
Код:
strmid(CarInfo[idx][cPlate], arrCoords[13], 0, strlen(arrCoords[13]), 16);
Edit: I tried LS96MRK and it saves just LS96MR. I think it saves just 4 letters.
Reply
#7

Hey man, you can save the Licenses Plates with this script?
Reply
#8

With the original GTARP, you can't. But with some (massive) edits, you can. With my script i can save even the tuning ). Ah, i forgot. I made the tuning sistem and in my pc works, but when i put it on the host, the modshops aren't working. I mean they are opening, but when i enter, nothing happens.
Reply
#9

No-one?
Reply
#10

The longest a number plate can be is 8
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)