[PRO-RP] RealLife Number plates -
Kwarde - 21.01.2011
Hi everyone! I've made an EASY, SMALL filterscript :P - "RealLife Number plates".
It's like the numberplates in the Netherlands (example: DJ-FK-44). The last number (integer) is the vehicle ID.
Load this filterscript as last! First do the other filterscripts. However this is the script:
pawn Code:
#include <a_samp>
public OnFilterScriptInit()
{
new str[32];
for(new i = 0; i < MAX_VEHICLES; i++){
new rand = random(20);
switch(rand){
case 0: format(str, 32, "ST-AT-");
case 1: format(str, 32, "LS-CA-");
case 2: format(str, 32, "NO-CA-");
case 3: format(str, 32, "KJ-VR-");
case 4: format(str, 32, "AK-JJ-");
case 5: format(str, 32, "VB-FK-");
case 6: format(str, 32, "WG-JX-");
case 7: format(str, 32, "GH-XL-");
case 8: format(str, 32, "JJ-ZL-");
case 9: format(str, 32, "TZ-DJ-");
case 10: format(str, 32, "HO-PV-");
case 11: format(str, 32, "RL-RP-");
case 12: format(str, 32, "PO-OP-");
case 13: format(str, 32, "LQ-IV-");
case 14: format(str, 32, "MV-MM-");
case 15: format(str, 32, "PC-NB-");
case 16: format(str, 32, "SA-MP-");
case 17: format(str, 32, "RP-DA");
case 18: format(str, 32, "KU-TJ-");
case 19: format(str, 32, "PH-BB-");
case 20: format(str, 32, "DG-MC-");
default: format(str, 32, "MafiaRP-");
}
format(str, 32, "%s%d", str, i);
if(IsACopVehicle(i)) format(str, 32, "SAPD %d", i);
SetVehicleNumberPlate(i, str);
SetVehicleToRespawn(i);
}
return 1;
}
stock IsACopVehicle(vehicleid)
{
new model = GetVehicleModel(vehicleid);
if(model == 523 || model == 430 || model == 427 || model == 490 || model == 528 || model >= 596 && model <= 601 || model == 497)
return true;
return false;
}
This's easy, isn't it?
- Kevin
p.s.
I need no credits for this ^^ - Unless if you wanna add them -.-
LAST EDIT: 21-01-2011 18:48 :: 'new str[32];' added, forgot that! Without it you'll get some errors :S
Re: [PRO-RP] RealLife Number plates -
Fool - 21.01.2011
really Simple, but its neat alright.
Re: [PRO-RP] RealLife Number plates -
sherlock - 21.01.2011
mm it would be nice for a more complex version like people can register plates and cops can check them
![Smiley](images/smilies/smile.png)
i need somthing like this for rp server.
Re: [PRO-RP] RealLife Number plates -
Stigg - 21.01.2011
It would be better if you could have this just for the valid number plate vehicles, this will try put a plate on planes and other none valid vehicles. Great idea though.
Peace...
Re: [PRO-RP] RealLife Number plates -
randy121ad - 21.01.2011
Quote:
Originally Posted by Kwarde
Hi everyone! I've made an EASY, SMALL filterscript :P - "RealLife Number plates".
It's like the numberplates in the Netherlands (example: DJ-FK-44). The last number (integer) is the vehicle ID.
Load this filterscript as last! First do the other filterscripts. However this is the script:
pawn Code:
#include <a_samp>
public OnFilterScriptInit() { for(new i = 0; i < MAX_VEHICLES; i++){ new rand = random(20); switch(rand){ case 0: format(str, 32, "ST-AT-"); case 1: format(str, 32, "LS-CA-"); case 2: format(str, 32, "NO-CA-"); case 3: format(str, 32, "KJ-VR-"); case 4: format(str, 32, "AK-JJ-"); case 5: format(str, 32, "VB-FK-"); case 6: format(str, 32, "WG-JX-"); case 7: format(str, 32, "GH-XL-"); case 8: format(str, 32, "JJ-ZL-"); case 9: format(str, 32, "TZ-DJ-"); case 10: format(str, 32, "HO-PV-"); case 11: format(str, 32, "RL-RP-"); case 12: format(str, 32, "PO-OP-"); case 13: format(str, 32, "LQ-IV-"); case 14: format(str, 32, "MV-MM-"); case 15: format(str, 32, "PC-NB-"); case 16: format(str, 32, "SA-MP-"); case 17: format(str, 32, "RP-DA"); case 18: format(str, 32, "KU-TJ-"); case 19: format(str, 32, "PH-BB-"); case 20: format(str, 32, "DG-MC-"); default: format(str, 32, "MafiaRP-"); } format(str, 32, "%s%d", str, i); if(IsACopVehicle(i)) format(str, 32, "SAPD %d", i); SetVehicleNumberPlate(i, str); SetVehicleToRespawn(i); } return 1; }
stock IsACopVehicle(vehicleid) { new model = GetVehicleModel(vehicleid); if(model == 523 || model == 430 || model == 427 || model == 490 || model == 528 || model >= 596 && model <= 601 || model == 497) return true; return false; }
This's easy, isn't it?
- Kevin
p.s.
I need no credits for this ^^ - Unless if you wanna add them -.-
|
hey mag ik eens iets vragen ik kom denk ik een include tekort
error 017: undefined symbol "str"
error 017: undefined symbol "str"
error 017: undefined symbol "str"
error 017: undefined symbol "str"
error 017: undefined symbol "str"
error 017: undefined symbol "str"
zo supperveel fouten kan je helpen ??
,alvast bedankt
Re: [PRO-RP] RealLife Number plates -
Kwarde - 21.01.2011
In English please, so the other people can understand
And F*CK, I forgot the
new str[32];. Thanks
@Sherlock & Porsche:
Maybe I'll do later. I was just a bit bored, so I decided to release this part from my gamemode
![Wink](images/smilies/wink.png)
However I forgot some critical thing. "new str[32];" :S - I'll add it.
Re: [PRO-RP] RealLife Number plates -
wups - 21.01.2011
There is a better format.
pawn Code:
public OnVehicleSpawn(vehicleid)
{
new string[50],
model;
model = GetVehicleModel(vehicleid);
format(string,sizeof(string),"{000000}%c%c%c %i%i%i",(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10),random(10)); // feel free to change the format.
if(!IsAPlane(model) && !IsABoat(model)) SetVehicleNumberPlate(vehicleid,string);
}
This makes completely random numbers.
Re: [PRO-RP] RealLife Number plates -
Stigg - 21.01.2011
Quote:
Originally Posted by wups
There is a better format.
pawn Code:
public OnVehicleSpawn(vehicleid) { new string[50], model; model = GetVehicleModel(vehicleid); format(string,sizeof(string),"{000000}%c%c%c %i%i%i",(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10),random(10)); // feel free to change the format. if(!IsAPlane(model) && !IsABoat(model)) SetVehicleNumberPlate(vehicleid,string); }
This makes completely random numbers.
|
Nice, i like this better. Thanks.
Peace...
Re: [PRO-RP] RealLife Number plates -
Mujib - 06.02.2011
Quote:
Originally Posted by wups
There is a better format.
pawn Code:
public OnVehicleSpawn(vehicleid) { new string[50], model; model = GetVehicleModel(vehicleid); format(string,sizeof(string),"{000000}%c%c%c %i%i%i",(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10),random(10)); // feel free to change the format. if(!IsAPlane(model) && !IsABoat(model)) SetVehicleNumberPlate(vehicleid,string); }
This makes completely random numbers.
|
The point of this FS is that he wants to set Dutch numberplates.
Re: [PRO-RP] RealLife Number plates -
wups - 20.02.2011
Quote:
Originally Posted by Mujib
The point of this FS is that he wants to set Dutch numberplates.
|
It's so easy to change the format!
pawn Code:
public OnVehicleSpawn(vehicleid)
{
new string[50],
model;
model = GetVehicleModel(vehicleid);
format(string,sizeof(string),"{000000}%c%c-%c%c-%i%i",(65+random(26)),(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10)); // feel free to change the format.
if(!IsAPlane(model) && !IsABoat(model)) SetVehicleNumberPlate(vehicleid,string);
}
Here's the Dutch one.