Ich habs so gemacht, halt als Bauer , und funktioniert:
enum BauernCPDaten {
Float:bCP_X,
Float:bCP_Y,
Float:bCP_Z
}
new BauernCP[][BauernCPDaten] = {
{20.4214,62.7821,4.0922},
{-10.8430,-8.3040,4.0942},
{-37.7827,-82.3471,4.0944},
{-25.6119,-91.4447,4.0945},
{25.8801,35.8845,4.0945},
{42.0253,43.7315,3.4804},
{5.0298,-44.1023,4.0918},
{-12.0191,-89.1497,4.0932},
{3.7829,-106.2996,2.7385},
{45.7055,7.3281,3.4091},
{64.6364,30.4883,1.6147},
{31.3213,-59.0014,3.0735},
{20.6863,-88.6571,2.4700},
{40.1048,-101.5151,1.5939},
{65.4498,-30.4873,1.7795},
{75.5787,22.4513,1.5867},
{-132.4013,49.3706,4.0941},
{-181.2694,-75.5866,4.0944},
{-231.7830,-73.5467,4.0945},
{-270.0512,-52.6578,4.0857},
{-251.5576,28.0954,3.1874},
{-233.3778,81.1003,3.1378},
{-203.7975,158.2948,6.7198}
};
command(farmen, playerid, params[]) {
if(SpielerInfo[playerid][pJob] != 2) return SendClientMessage(playerid, COLOR_RED, "Du bist kein Farmer");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Du bist in keinen Farmer-Fahrzeug");
if(IsBAUERNCAR(GetPlayerVehicleID(playerid))==0)return SendClientMessage(playerid, COLOR_RED, "Du bist in keinen Farmer-Fahrzeug2");
if(Job_Farmer[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du farmst bereits. Um aufzuhören verwende /stopfarmen");
Job_Farmer[playerid] = 1;
SendClientMessage(playerid, 0x009BFFFF, "Fahre nun die Checkpoins ab");
Job_Farmer_CP[playerid] = 0;
SetPlayerCheckpoint(playerid,BauernCP[0][bCP_X],BauernCP[0][bCP_Y],BauernCP[0][bCP_Z], 10.0);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new str[200], ok[200];
if(Job_Farmer[playerid] == 1) {
if(IsPlayerInRangeOfPoint(playerid, 10, BauernCP[Job_Farmer_CP[playerid]][bCP_X], BauernCP[Job_Farmer_CP[playerid]][bCP_Y], BauernCP[Job_Farmer_CP[playerid]][bCP_Z])) {
Job_Farmer_CP[playerid]++;
if(Job_Farmer_CP[playerid] >= sizeof(BauernCP)) {
new v = GetPlayerVehicleID(playerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(v);
SpielerInfo[playerid][pGeld] += 200;
Job_Farmer_CP[playerid] = 0;
Job_Farmer[playerid] = 0;
SendClientMessage(playerid, 0x00FFE6FF, "Die Ernte war erfolgreich!");
SendClientMessage(playerid, 0x00FFE6FF, "Für deine Arbeit erhälst du 200$");
DisablePlayerCheckpoint(playerid);
return 1;
} else {
format(str, sizeof(str), "[FARMEN] %i / %i Punkte", Job_Farmer_CP[playerid], sizeof(BauernCP));
SendClientMessage(playerid, 0xEBFF00FF, str);
SetPlayerCheckpoint(playerid, BauernCP[Job_Farmer_CP[playerid]][bCP_X], BauernCP[Job_Farmer_CP[playerid]][bCP_Y], BauernCP[Job_Farmer_CP[playerid]][bCP_Z], 10.0);
return 1;
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}