SA-MP Forums Archive
problem with numberplate - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with numberplate (/showthread.php?tid=214913)



problem with numberplate - pantelimonfl - 22.01.2011

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


Re: problem with numberplate - pantelimonfl - 22.01.2011

Anyone?


Re: problem with numberplate - pantelimonfl - 22.01.2011

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


Re: problem with numberplate - Typhome - 22.01.2011

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


Re: problem with numberplate - pantelimonfl - 22.01.2011

Where's that string limit?


Re: problem with numberplate - pantelimonfl - 23.01.2011

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.


Respuesta: problem with numberplate - [DOG]irinel1996 - 23.01.2011

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


Re: problem with numberplate - pantelimonfl - 23.01.2011

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.


Re: problem with numberplate - pantelimonfl - 24.01.2011

No-one?


Re: problem with numberplate - Joe Staff - 24.01.2011

The longest a number plate can be is 8