SetVehicleNumberPlate - 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: SetVehicleNumberPlate (
/showthread.php?tid=197953)
SetVehicleNumberPlate -
Jay_ - 10.12.2010
Quote:
Please use this function with care and don't go assigning custom numberplates to vehicles that don't have plates (like planes/boats etc), as this would result in unneeded processing time on the client.
|
Referring to the above quote, wouldn't it be much better if the function had built in error checking to prevent this?
Re: SetVehicleNumberPlate -
Hiitch - 10.12.2010
It would, but I guess it's up to you to create a function that checks to see what vehicle they are in, and tell them they can not change it, otherwise, let them.
Re: SetVehicleNumberPlate -
The_Gangstas - 10.12.2010
simply just
pawn Код:
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(IsAPlane(GetVehicleModel(v))) continue;
if(IsABoat(GetVehicleModel(v))) continue;
//do stuff
stock IsAPlane(modelid)
{
switch(modelid)
{
case 593,592,577,563,553,548,520,519,513,512,511,
497,488,487,476,469,460,447,425,417,493,484,453: return 1;
default: return 0;
}
return 0;
}
stock IsABoat(modelid)
{
switch(modelid)
{
case 472,473,595,493,430,453,484,446,452,454: return 1;
default: return 0;
}
return 0;
}
Re: SetVehicleNumberPlate -
Retardedwolf - 10.12.2010
@The_Gangstas, his asking for a built in error checker not a scripting way of doing it and I'm pretty sure he knows how to do that.
Re: SetVehicleNumberPlate -
The_Moddler - 10.12.2010
Yea, I didn't even think about this Jay_, +1 to this.
Re: SetVehicleNumberPlate -
Sergei - 10.12.2010
It should simply return 1 if plate could be set and 0 if not.
Re: SetVehicleNumberPlate -
woot - 10.12.2010
Indeed, I find it quite annoying that server developers always have to find a workaround for everything, while it could be simply hardcorded making life much easier / faster.