Hey ich hab ein Problem mit meinen Fraktions Autos.
Ich erstelle alles und bekomme dann Warnings und Errors.
Hoffe das mir wer helfen kann.
Oben im Script:
new LVPDCars[24];
forward IsALVPDCar(carid);
Bei OnGameModeInit:
LVPDCars[0]= AddStaticVehicle(598, 2316.5041503906, 2431.9306640625, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (1)
LVPDCars[1]= AddStaticVehicle(598, 2312.193359375, 2431.6713867188, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (2)
LVPDCars[2]= AddStaticVehicle(598, 2307.8674316406, 2431.8369140625, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (3)
LVPDCars[3]= AddStaticVehicle(598, 2303.0437011719, 2431.8850097656, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (4)
LVPDCars[4]= AddStaticVehicle(598, 2299.1599121094, 2431.7810058594, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (5)
LVPDCars[5]= AddStaticVehicle(598, 2294.8151855469, 2431.6918945313, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (6)
LVPDCars[6]= AddStaticVehicle(598, 2290.1704101563, 2431.9045410156, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (7)
LVPDCars[7]= AddStaticVehicle(598, 2285.6733398438, 2431.8332519531, 3.1434371471405, 0.000000, -1, -1); //vehicle (police lv) (8)
LVPDCars[8]= AddStaticVehicle(599, 2276.8295898438, 2432.2902832031, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (2)
LVPDCars[9]= AddStaticVehicle(599, 2272.6669921875, 2432.4084472656, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (3)
LVPDCars[10]= AddStaticVehicle(599, 2268.1801757813, 2432.3881835938, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (4)
LVPDCars[11]= AddStaticVehicle(599, 2263.6193847656, 2432.4089355469, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (5)
LVPDCars[12]= AddStaticVehicle(599, 2259.7155761719, 2432.2553710938, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (6)
LVPDCars[13]= AddStaticVehicle(599, 2251.1315917969, 2432.3103027344, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (7)
LVPDCars[14]= AddStaticVehicle(599, 2254.8933105469, 2432.5002441406, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (8)
LVPDCars[15]= AddStaticVehicle(599, 2246.5283203125, 2433.0498046875, 3.6585640907288, 0.000000, -1, -1); //vehicle (police ranger) (9)
LVPDCars[16]= AddStaticVehicle(490, 2241.7241210938, 2438.0974121094, 3.5935640335083, 272.66064453125, -1, -1); //vehicle (fbi rancher) (1)
LVPDCars[17]= AddStaticVehicle(490, 2242.0925292969, 2442.20703125, 3.5935640335083, 272.65869140625, -1, -1); //vehicle (fbi rancher) (2)
LVPDCars[18]= AddStaticVehicle(490, 2242.0952148438, 2446.7272949219, 3.5935640335083, 272.65869140625, -1, -1); //vehicle (fbi rancher) (3)
LVPDCars[19]= AddStaticVehicle(525, 2251.6616210938, 2444.7849121094, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (1)
LVPDCars[20]= AddStaticVehicle(525, 2255.8425292969, 2445.4265136719, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (2)
LVPDCars[21]= AddStaticVehicle(525, 2260.767578125, 2444.74609375, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (3)
LVPDCars[22]= AddStaticVehicle(525, 2252.0615234375, 2458.5029296875, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (4)
LVPDCars[23]= AddStaticVehicle(525, 2256.298828125, 2458.1796875, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (5)
>>>LVPDCars[24]= AddStaticVehicle(525, 2260.6862792969, 2457.9140625, 10.810312271118, 0.000000, -1, -1); //vehicle (towtruck) (6)
Dann die public hier unten:
public IsALVPDCar(carid)
{
for(new i = 0; i < sizeof(LVPDCars); i++)
{
if(carid == LVPDCars[i])
{
return 1;
}
}
return 0;
}
Und dann bei OnPlayerStateChange:
>>>else if(IsALVPDCar(newcar))
{
if (pInfo[playerid][team] == 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Mitglied des LVPD");
return 1;
}
}
Hoffe das ihr mir helfen könnt.
Grüße Yomo
Oh ja sry Edit Errors, hab vor die Zeilen ein >>> gemacht:
C:\Users\PC\Desktop\Server_Wichtig\NLC_Server\gamemodes\rl.pwn(198) : error 032: array index out of bounds (variable "LVPDCars")
C:\Users\PC\Desktop\Server_Wichtig\NLC_Server\gamemodes\rl.pwn(1348) : error 017: undefined symbol "newcar"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.