Hey Leute,
Ich brauche ein wenig hilfe bei meinem Autodieb Job.
Das habe ich bis jetzt gescriptet:
Wenn ich /vehcheck eingebe spawnen von 50 Fahrzeugen 25 Stück auf der Map verteilt
if (strcmp("/vehcheck", cmdtext, true) == 0)
{
new tmp[sizeof(AutodiebCar)], ex;
for(new i=0; i < 25; i++)
{
new Veh = random(sizeof(AutodiebCar));
while(tmp[Veh] == 1)
{
Veh++;
if(Veh >= sizeof(AutodiebCar)) Veh = 0;
ex++;
if(ex > 10000) return SendClientMessage(playerid, 0xFF0000FF, "Error"); //Falls jedes Auto gespawnt ist.
}
tmp[Veh] = 1;
CreateVehicle(AutodiebCar[Veh][carid],AutodiebCar[Veh][x],AutodiebCar[Veh][y],AutodiebCar[Veh][z],AutodiebCar[Veh][r],AutodiebCar[Veh][farbe1],AutodiebCar[Veh][farbe2],0);
}
return 1;
}
Hier sind diese Fahrzeuge:
new AutodiebCar[51][VehCheck] =
{
{401,1676.8239,-1129.3467,23.6865,89.6464,52,52},
{402,2206.4460,-1165.1312,25.5614,270.5780,22,22},
{404,2195.6545,-46.7130,27.1444,269.7824,101,101},
{405,1761.9731,-1045.6183,23.8359,359.3851,40,1},
{404,2147.8108,-1143.2487,24.7029,268.2522,109,100},
{402,2161.8760,-1192.3782,23.6519,89.9787,39,39},
{415,2349.4333,-1245.0852,22.2719,88.8755,62,1},
{421,2431.3474,-1242.6738,24.1295,358.1162,13,1},
{421,2431.3474,-1242.6738,24.1295,358.1162,13,1},
{541,318.0052,-1809.3193,4.1030,179.7878,58,8},
{422,-253.2505,-2242.8364,28.5792,25.0541,101,25},
{405,-18.0520,-2500.6365,36.5234,301.2255,91,1},
{404,342.9126,-1347.0306,14.2418,298.4992,123,92},
{421,-1560.3499,-2740.1223,48.4255,325.2626,30,1},
{422,-2151.3784,-2440.6001,30.6133,142.6557,111,31},
{401,-2233.2280,-2569.9270,31.7013,61.7709,66,66},
{404,-2630.5400,-34.2985,4.0699,0.1377,101,101},
{415,-2573.2188,632.5678,14.2311,270.7216,40,1},
{401,-2464.6194,741.7357,34.7952,1.3153,74,74},
{411,-2076.9033,-83.6164,34.9197,180.0766,75,1},
{405,-2266.3628,97.3358,35.0468,88.7578,75,1},
{402,-2171.6294,293.0921,34.9488,359.0792,39,39},
{451,-1932.2777,585.6349,34.8246,180.2158,36,36},
{422,-96.6464,1222.0179,19.7245,180.5412,83,57},
{404,-34.2363,1165.8403,19.1767,358.7928,66,25},
{421,-866.0565,1566.2944,24.6596,268.5714,75,1},
{405,-1204.1842,1813.2852,41.5937,43.4905,91,1},
{401,-1272.9730,2707.4041,49.8459,29.0916,91,91},
{421,-213.5925,2595.1809,62.5856,179.4616,95,1},
{402,686.4581,1948.6323,5.3708,0.0715,98,98},
{401,652.7128,1715.3029,6.7752,220.7926,113,113},
{415,984.0393,1740.4409,8.4231,270.4149,75,1},
{405,1541.4226,787.9304,10.6953,359.6116,36,1},
{405,1843.8953,1219.1794,10.7040,90.2572,40,1},
{402,1890.0981,1988.9661,7.4262,359.7332,13,13},
{411,1875.6113,1989.4563,13.5401,359.9025,106,1},
{415,1939.5638,1800.8657,18.6761,179.9748,92,1},
{404,2186.7068,2000.2368,10.5541,270.4964,113,39},
{422,2272.6599,1938.7421,9.8553,178.7896,111,31},
{405,2276.2742,1938.7299,20.6971,179.1952,75,1},
{402,2222.0298,1940.2933,31.6114,270.8122,22,22},
{421,2534.9382,2014.6157,10.7028,270.7671,25,1},
{405,2588.4351,2078.1873,10.6898,270.0092,91,1},
{401,2571.6848,2196.8845,10.5998,0.6399,41,41},
{422,2404.0396,2547.4429,21.8593,90.6007,83,57},
{421,2524.1970,2363.3013,4.0986,269.5284,30,1},
{402,2564.8503,2275.3809,10.6520,89.8653,39,39},
{421,2866.8005,2334.4634,10.7028,269.3053,75,1},
{405,2452.1345,1629.4126,10.6952,0.2558,40,1},
{401,2182.5898,987.7349,10.5998,179.7777,66,66},
{411,1646.0748,-1702.9684,20.2393,268.4882,80,1}
};
Das funktioniert ja so weit jedoch möchte ich checken ob der Spieler in der nähe eines "AutodiebCar" ist und wenn ja kann er /aufbrechen eingeben.Dann muss er 2 Minuten warten und das Fahrzeug ist aufgebrochen und kann von dem Autodieb gefahren werden.
if (strcmp("/aufbrechen", cmdtext, true) == 0)
{
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(AutodiebCar,vehx,vehy,vehz);
if(IsPlayerInRangeOfPoint(playerid,1,vehx,vehy,vehz);
{
SetTimer("AutodiebAufbrechenT",120000,0);
}
return 1;
}
Hier habe ich das bei "OnPlayerStateChange".Wenn er rein geht müsste er ja wieder rausgeworfen werden..Wie stelle ich es an das er garnicht erst rein kann?Bzw. das das Fahrzeug sozusagen abgeschlossen ist ?
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i<sizeof(AutodiebCar); i++)
{
if(GetPlayerVehicleID(playerid)==AutodiebCar[i])
{
if(!IsPlayerAutodieb(playerid,1))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,F_Gray,"Du musst dieses Fahrzeug erstmal aufbrechen!");
}
else
{
SendClientMessage(playerid,F_Green,"Bringe das Fahrzeug zu Tony wenn du ein wenig Kohle kassieren möchtest!");
}
}
}
}
Bei dem ganzem bekomme ich diese Errors:
(1468) : error 033: array must be indexed (variable "AutodiebCar")
(789) : error 035: argument type mismatch (argument 1)
(791) : error 001: expected token: ")", but found ";"
(791) : error 036: empty statement
Ich hoffe ihr könnt mir weiter helfen..Sagt bescheid wenn ihr mehr aus dem Script braucht.
Ich lasse mir auch sehr gerne über TeamViewer helfen.Dazu kommt ihr am besten auf diesen TS: 128.127.66.10 PW: t2r