SHOW:
|
|
- or go back to the newest paste.
1 | - | //GetVehicleNumberPlate, by irinel1996 |
1 | + | //GetVehicleNumberPlate, by irinel1996 | Updated by Y_Less |
2 | ||
3 | #if !defined strcpy | |
4 | #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1) | |
5 | #endif | |
6 | ||
7 | static stock | |
8 | bool:gvnp_gInit = false, | |
9 | gvnp_gFail[10] = "", | |
10 | gvnp_gLicencia[MAX_VEHICLES][10]; | |
11 | ||
12 | public OnFilterScriptInit() | |
13 | { | |
14 | if (!gvnp_gInit) | |
15 | { | |
16 | for (new vehicle = 0; vehicle != MAX_VEHICLES; ) | |
17 | { | |
18 | gvnp_gLicencia[++vehicle] = "XYZR 000"; | |
19 | } | |
20 | gvnp_gInit = true; | |
21 | } | |
22 | CallLocalFunction("gvnp_OnFilterScriptInit", ""); | |
23 | } | |
24 | ||
25 | #if defined _ALS_OnFilterScriptInit | |
26 | #undef OnFilterScriptInit | |
27 | #else | |
28 | #define _ALS_OnFilterScriptInit | |
29 | #endif | |
30 | #define OnFilterScriptInit gvnp_OnFilterScriptInit | |
31 | ||
32 | forward OnFilterScriptInit(); | |
33 | ||
34 | public OnGameModeInit() | |
35 | { | |
36 | if (!gvnp_gInit) | |
37 | { | |
38 | for (new vehicle = 0; vehicle != MAX_VEHICLES; ) | |
39 | { | |
40 | gvnp_gLicencia[++vehicle] = "XYZR 000"; | |
41 | } | |
42 | gvnp_gInit = true; | |
43 | } | |
44 | CallLocalFunction("gvnp_OnGameModeInit", ""); | |
45 | } | |
46 | ||
47 | #if defined _ALS_OnGameModeInit | |
48 | #undef OnGameModeInit | |
49 | #else | |
50 | #define _ALS_OnGameModeInit | |
51 | #endif | |
52 | #define OnGameModeInit gvnp_OnGameModeInit | |
53 | ||
54 | forward OnGameModeInit(); | |
55 | ||
56 | stock gvnp_SetVehicleNumberPlate(vehicleid, numero[]) | |
57 | { | |
58 | if (0 <= --vehicleid < MAX_VEHICLES) | |
59 | { | |
60 | strcpy(gvnp_gLicencia[vehicleid], numero, sizeof (gvnp_gLicencia[])); | |
61 | return SetVehicleNumberPlate(vehicleid, numero); | |
62 | } | |
63 | return 0; | |
64 | } | |
65 | ||
66 | #if defined _ALS_SetVehicleNumberPlate | |
67 | #undef SetVehicleNumberPlate | |
68 | #else | |
69 | #define _ALS_SetVehicleNumberPlate | |
70 | #endif | |
71 | #define SetVehicleNumberPlate gvnp_SetVehicleNumberPlate | |
72 | ||
73 | stock GetVehicleNumberPlate(vehicleid) | |
74 | { | |
75 | if (1 <= vehicleid <= MAX_VEHICLES) | |
76 | { | |
77 | return gvnp_gLicencia[vehicleid - 1]; | |
78 | } | |
79 | return gvnp_gFail; | |
80 | } |