Guten tag. Also ich arbeite zurzeit an einem Freeroam Gamemode der leider ein wenig buggy ist
Also nun zum Problem: Ich habe bisher 2 sogenannte Checkpointmissionen erstellt aber es gibt trotzdem immernoch bugs!
Leider lassen sich die Bugs schwer erklären darum hoffe ich die sind hier erkennbar
Hier die Scriptausschnitte:
Code
new Checkpoint[MAX_PLAYERS];
new mission[MAX_PLAYERS];
new Cp[MAX_PLAYERS];
new missi[MAX_PLAYERS];
forward missionfailed(playerid);
Code
// Trashcars:
AddStaticVehicle(408,-557.6525,-496.0215,25.8682,359.8282,1,1);
AddStaticVehicle(408,-529.8904,-496.0005,25.8726,359.8877,1,1);
AddStaticVehicle(408,-520.3101,-495.8940,25.8795,359.9233,1,1);
AddStaticVehicle(408,-535.8450,-502.6665,26.0667,358.0911,1,1);
// Securicars:
AddStaticVehicle(428,2223.5510,2463.3152,-7.3229,272.1580,4,75); //
AddStaticVehicle(428,2223.8716,2457.9707,-7.3285,275.3260,4,75); //
AddStaticVehicle(428,2223.3474,2453.0784,-7.3294,270.8000,4,75); //
Alles anzeigen
Code
new vehicleid = GetPlayerVehicleID(playerid);
new car = GetVehicleModel(vehicleid);
if (strcmp("/security", cmd, true, 5) == 0) {
if(missi[playerid] == 0)
{
if(car == 428)
{
new pName[MAX_PLAYER_NAME];
new string [128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "-Missioninfo- %s (%d) hat die Security Mission gestartet. (/Security) ", pName, playerid);
SendClientMessageToAll(0xFF8200FF, string);
SetPlayerCheckpoint(playerid, 2246.0439,2441.9360,-7.3288, 5.0);
Cp[playerid] = 1;
missi[playerid] =1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du musst im Securitycar sein um diese Mission zu starten.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du bist bereits in einer Mission.");
}
return 1;
}
new model = GetVehicleModel(vehicleid);
if (strcmp("/muell", cmd, true, 5) == 0) {
if(mission[playerid] == 0)
{
if(model == 408)
{
new pName[MAX_PLAYER_NAME];
new string [128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "-Missioninfo- %s (%d) hat die Muellabfuhr Mission gestartet. (/Muell) ", pName, playerid);
SendClientMessageToAll(0xFF8200FF, string);
SetPlayerCheckpoint(playerid, -74.2252,-1128.7936,1.6359, 5.0);
Checkpoint[playerid] = 1;
mission[playerid] =1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du musst in einem Muellwagen sein um diese Mission zu starten.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du bist bereits in einer Mission.");
}
return 1;
}
Alles anzeigen
Code
public OnPlayerExitVehicle(playerid, vehicleid) {
new model = GetVehicleModel(vehicleid);
if(model == 408)
{
if (mission[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du hast 60 Sekunden Zeit um zurueck in den Muellwagen zu steigen!");
SetTimerEx("missionfailed", 60000, 0,"i",playerid);
}
return 1;
}
new car = GetVehicleModel(vehicleid);
if(car == 428)
{
if (missi[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "-Warnung- Du hast 60 Sekunden um zurueck in das Securitycar zu steigen!");
SetTimerEx("missionfailed", 60000, 0,"i",playerid);
}
return 1;
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid) {
if(Checkpoint[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -89.2432,-1189.7782,2.3241, 5.0);
Checkpoint[playerid] = 2;
}
else if(Checkpoint[playerid] == 2)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -63.3734,-1588.5732,3.1782, 5.0);
Checkpoint[playerid] = 3;
}
else if(Checkpoint[playerid] == 3)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 220.8943,-1393.5308,52.1264, 5.0);
Checkpoint[playerid] = 4;
}
else if(Checkpoint[playerid] == 4)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 169.0361,-1356.8065,69.8208, 5.0);
Checkpoint[playerid] = 5;
}
else if(Checkpoint[playerid] == 5)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 263.5524,-1341.0842,53.7643, 5.0);
Checkpoint[playerid] = 6;
}
else if(Checkpoint[playerid] == 6)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 871.9646,-864.5255,77.2742, 5.0);
Checkpoint[playerid] = 7;
}
else if(Checkpoint[playerid] == 7)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 935.7687,-835.7352,94.4455, 5.0);
Checkpoint[playerid] = 8;
}
else if(Checkpoint[playerid] == 8 )
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1496.5879,-698.0237,94.5207, 5.0);
Checkpoint[playerid] = 9;
}
else if(Checkpoint[playerid] == 9)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1001.1724,-935.0218,41.9509, 5.0);
Checkpoint[playerid] = 10;
}
else if(Checkpoint[playerid] == 10)
{
SendClientMessage(playerid,0xFF8200FF , "-Missioninfo- Das war das letzte Haus. Fahre nun zurueck.");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -546.9002,-488.6077,25.2961, 5.0);
Checkpoint[playerid] = 11;
}
else if(Checkpoint[playerid] == 11)
{
GameTextForPlayer(playerid,"~r~Mission beendet!~n~+20000$",5000,1);
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid, 20000);
SendClientMessage(playerid, 0xFF8200FF, "-Missioninfo- Mission erfolgreich beendet.");
mission[playerid] = 0;
}
if(Cp[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2306.8762,2450.6028,-7.3295, 5.0);
Cp[playerid] = 2;
}
else if(Cp[playerid] == 2)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2298.1235,2497.6606,-7.3287, 5.0);
Cp[playerid] = 3;
}
else if(Cp[playerid] == 3)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2242.4246,2495.7542,3.3946, 5.0);
Cp[playerid] = 4;
}
else if(Cp[playerid] == 4)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2248.6465,2435.1501,3.3978, 5.0);
Cp[playerid] = 5;
}
else if(Cp[playerid] == 5)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2323.7285,2446.7585,3.8019, 5.0);
Cp[playerid] = 6;
}
else if(Cp[playerid] == 6)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2325.5239,2415.9705,10.7969, 5.0);
Cp[playerid] = 7;
}
else if(Cp[playerid] == 7)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2225.3799,2404.3748,10.8236, 5.0);
Cp[playerid] = 8;
}
else if(Cp[playerid] == 8 )
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2178.2046,2347.8359,10.7951, 5.0);
Cp[playerid] = 9;
}
else if(Cp[playerid] == 9)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2178.2046,2347.8359,10.7951, 5.0);
Cp[playerid] = 10;
}
else if(Cp[playerid] == 10)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2074.0618,2285.6904,10.7966, 5.0);
Cp[playerid] = 11;
}
else if(Cp[playerid] == 11)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1886.9503,2274.7603,10.7962, 5.0);
Cp[playerid] = 12;
}
else if(Cp[playerid] == 12)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1752.8148,2275.6499,11.2736, 5.0);
Cp[playerid] = 13;
}
else if(Cp[playerid] == 13)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1724.7463,2249.1167,10.7965, 5.0);
Cp[playerid] = 14;
}
else if(Cp[playerid] == 14)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1704.6075,2141.9143,10.7964, 5.0);
Cp[playerid] = 15;
}
else if(Cp[playerid] == 15)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1705.6682,1999.2211,10.7672, 5.0);
Cp[playerid] = 16;
}
else if(Cp[playerid] == 16)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1645.0474,1876.2433,10.8770, 5.0);
Cp[playerid] = 17;
}
else if(Cp[playerid] == 17)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1334.1927,1874.3568,10.7956, 5.0);
Cp[playerid] = 18;
}
else if(Cp[playerid] == 18)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1334.1927,1874.3568,10.7956, 5.0);
Cp[playerid] = 19;
}
else if(Cp[playerid] == 19)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1334.1927,1874.3568,10.7956, 5.0);
Cp[playerid] = 20;
}
else if(Cp[playerid] == 20)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1268.0006,1815.8032,11.4643, 5.0);
Cp[playerid] = 21;
}
else if(Cp[playerid] == 21)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1004.9506,1772.3983,10.8979, 5.0);
Cp[playerid] = 22;
}
else if(Cp[playerid] == 22)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1005.7490,1497.2260,10.7964, 5.0);
Cp[playerid] = 23;
}
else if(Cp[playerid] == 23)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1005.4980,1306.4567,10.7967, 5.0);
Cp[playerid] = 24;
}
else if(Cp[playerid] == 24)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 999.7475,1144.2979,10.9326, 5.0);
Cp[playerid] = 25;
}
else if(Cp[playerid] == 25)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 981.5842,1108.0187,10.9447, 5.0);
Cp[playerid] = 26;
}
else if(Cp[playerid] == 26)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 992.2762,1071.6866,10.9450, 5.0);
Cp[playerid] = 27;
}
else if(Cp[playerid] == 27)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1009.7815,1103.8018,10.9448, 5.0);
Cp[playerid] = 28;
}
else if(Cp[playerid] == 28)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1029.3813,1173.6459,10.7986, 5.0);
Cp[playerid] = 29;
}
else if(Cp[playerid] == 29)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1429.3673,1190.2822,10.7943, 5.0);
Cp[playerid] = 30;
}
else if(Cp[playerid] == 30)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1444.7209,1156.8872,10.7965, 5.0);
Cp[playerid] = 31;
}
else if(Cp[playerid] == 31)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1470.3650,1130.7930,10.7961, 5.0);
Cp[playerid] = 32;
}
else if(Cp[playerid] == 32)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1802.5254,1130.8710,13.9583, 5.0);
Cp[playerid] = 33;
}
else if(Cp[playerid] == 33)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1865.5388,1101.7877,10.8302, 5.0);
Cp[playerid] = 34;
}
else if(Cp[playerid] == 34)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1865.1816,966.4839,10.7966, 5.0);
Cp[playerid] = 35;
}
else if(Cp[playerid] == 35)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1938.0576,931.3959,10.7966, 5.0);
Cp[playerid] = 36;
}
else if(Cp[playerid] == 36)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2019.1207,970.5776,10.7380, 5.0);
Cp[playerid] = 37;
}
else if(Cp[playerid] == 37)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2069.6526,994.2156,10.7960, 5.0);
Cp[playerid] = 38;
}
else if(Cp[playerid] == 38)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2069.7698,1267.0344,10.7959, 5.0);
Cp[playerid] = 39;
}
else if(Cp[playerid] == 39)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2087.3708,1738.0078,10.7959, 5.0);
Cp[playerid] = 40;
}
else if(Cp[playerid] == 40)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2150.0769,1917.7069,10.8041, 5.0);
Cp[playerid] = 41;
}
else if(Cp[playerid] == 41)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2149.6687,2189.3535,10.7969, 5.0);
Cp[playerid] = 42;
}
else if(Cp[playerid] == 42)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2174.1243,2300.7639,10.7961, 5.0);
Cp[playerid] = 43;
}
else if(Cp[playerid] == 43)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2228.4783,2396.7490,10.7984, 5.0);
Cp[playerid] = 44;
}
else if(Cp[playerid] == 44)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2282.9973,2410.9629,10.9077, 5.0);
Cp[playerid] = 45;
}
else if(Cp[playerid] == 45)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2345.3103,2432.9241,8.9769, 5.0);
Cp[playerid] = 46;
}
else if(Cp[playerid] == 46)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2301.7590,2482.9524,3.3988, 5.0);
Cp[playerid] = 47;
}
else if(Cp[playerid] == 47)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2260.3513,2497.6980,1.1277, 5.0);
Cp[playerid] = 48;
}
else if(Cp[playerid] == 48)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2239.8716,2459.0903,-7.3286, 5.0);
Cp[playerid] = 49;
}
else if(Cp[playerid] == 49)
{
GameTextForPlayer(playerid, "~r~mission beendet!~n~70000$", 5000, 1);
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid, 70000);
SendClientMessage(playerid, 0xFF8200FF, "-Missioninfo- Mission erfolgreich beendet.");
missi[playerid] = 0;
}
return 1;
}
public missionfailed(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicleid);
if(model == 408)
{ }
else
{
GameTextForPlayer(playerid,"mission gescheitert!",5000,1);
DisablePlayerCheckpoint(playerid);
mission[playerid] = 0;
}
new car = GetVehicleModel(vehicleid);
if(car == 428)
{ }
else
{
GameTextForPlayer(playerid,"mission gescheitert!",5000,1);
DisablePlayerCheckpoint(playerid);
missi[playerid] = 0;
}
return 1;
}
Alles anzeigen
Kann das vielleicht jemand für mich fixen?