Hi,
hier ist ein kleines Farmer Script. Es funktioniet so:
Farmer mäht (Checkpoints) -> liefert es an der Scheune -> Holt es später wieder ab -> Feld kan nur alle 20 Minuten gerntet werden.
Ihr könnt es als FS nutzen (umschreibpflicht !!) oder ins GM einbauen.
Defines:
ZitatAlles anzeigen#define COLOR_GREY 0xBFC0C2FF
#define COLOR_GREEN 0x33AA33AA
forward PrepareArmorDrug(playerid);
forward LockedFarmerField();
enum pInfo
{
pArmorDrugs,
pHarvesting,
pPrepareArmorDrugs,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new farmer1,farmer2;
new FarmersLocked;
new HarvestCP[MAX_PLAYERS];
new TAKEDRUGCP[MAX_PLAYERS];
new armordrugprepare;
OnPlayerCommandText:
ZitatAlles anzeigenif(strcmp(cmd, "/harvest", true) == 0)
{
new vehicle = GetPlayerVehicleID(playerid);
if(vehicle == farmer1 || vehicle == farmer2)
{
if(IsPlayerConnected(playerid))
{
if(FarmersLocked != 0)
{
SendClientMessage(playerid, COLOR_GREY, " Wait until the field is growed");
return 1;
}
if(PlayerInfo[playerid][pPrepareArmorDrugs] != 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are already done your harvest !");
return 1;
}
if(PlayerInfo[playerid][pHarvesting] != 0)
{
SendClientMessage(playerid, COLOR_GREY, " You already started harvesting !");
return 1;
}
SendClientMessage(playerid, COLOR_GREEN, " You can start harvesting by following the checkpoints ");
PlayerInfo[playerid][pHarvesting] = 1;
SetPlayerCheckpoint(playerid, -373.1057,-1427.1637,25.7266, 2.0);
HarvestCP[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Use the Combine to harvest !");
return 1;
}
}
return 1;
}
OnPlayerConnect:
ZitatPlayerInfo[playerid][pArmorDrugs] = 0;
PlayerInfo[playerid][pHarvesting] = 0;
PlayerInfo[playerid][pPrepareArmorDrugs] = 0;
OnGameModeInit:
Zitatfarmer1 = AddStaticVehicleEx(532,-377.160,-1453.533,26.836,0.0,-1,-1,-1);//Cobine
farmer2 = AddStaticVehicleEx(532,-412.861,-1441.822,26.606,24.0,-1,-1,-1);//Cobine;
FarmersLocked = 0;
OnPlayerEnterCheckpoint:
ZitatAlles anzeigenif(HarvestCP[playerid] == 1) { HarvestCP[playerid] = 2; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -259.3036,-1318.0707,9.9516, 2.0); }
else if(HarvestCP[playerid] == 2) { HarvestCP[playerid] = 3; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -192.6255,-1313.5842,7.0996, 2.0); }
else if(HarvestCP[playerid] == 3) { HarvestCP[playerid] = 4; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -177.7839,-1333.6204,4.4496, 2.0); }
else if(HarvestCP[playerid] == 4) { HarvestCP[playerid] = 5; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -214.6318,-1338.9938,11.2143, 2.0); }
else if(HarvestCP[playerid] == 5) { HarvestCP[playerid] = 6; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -285.3203,-1344.9944,7.6228, 2.0); }
else if(HarvestCP[playerid] == 6) { HarvestCP[playerid] = 7; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -323.0420,-1368.2023,10.4217, 2.0); }
else if(HarvestCP[playerid] == 7) { HarvestCP[playerid] = 8; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -276.8720,-1374.8575,10.2330, 2.0); }
else if(HarvestCP[playerid] == 8) { HarvestCP[playerid] = 9; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -230.6246,-1375.9276,8.8320, 2.0); }
else if(HarvestCP[playerid] == 9) { HarvestCP[playerid] = 10; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -179.5007,-1380.9139,4.1932, 2.0); }
else if(HarvestCP[playerid] == 10) { HarvestCP[playerid] = 11; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -171.4424,-1403.3931,3.0291, 2.0); }
else if(HarvestCP[playerid] == 11) { HarvestCP[playerid] = 12; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -232.0035,-1413.1865,6.9737, 2.0); }
else if(HarvestCP[playerid] == 12) { HarvestCP[playerid] = 13; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -290.6899,-1418.3685,12.5166, 2.0); }
else if(HarvestCP[playerid] == 13) { HarvestCP[playerid] = 14; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -326.3864,-1418.6740,14.5028, 2.0); }
else if(HarvestCP[playerid] == 14)
{
SendClientMessage(playerid, COLOR_GREEN, " Bring your harvest to the Drug Store (Follow Checkpoint)");
SetTimer("LockedFarmerField", 300000, 0);
FarmersLocked = 1;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -373.1057,-1427.1637,25.7266, 2.0);
HarvestCP[playerid] = 15;
}
else if(HarvestCP[playerid] == 15)
{
armordrugprepare = SetTimer("PrepareArmorDrug", 120000,0);
SendClientMessage(playerid, COLOR_GREEN, " You can re-take your drugs in 2 minutes");
PlayerInfo[playerid][pPrepareArmorDrugs] = 1;
}
else if(TAKEDRUGCP[playerid] == 1)
{
PlayerInfo[playerid][pPrepareArmorDrugs] = 0;
PlayerInfo[playerid][pArmorDrugs] += 150;
SendClientMessage(playerid, COLOR_GREEN, " You get 150 armor drugs");
}
Unten ins Script:
ZitatAlles anzeigenpublic PrepareArmorDrug(playerid)
{
TAKEDRUGCP[playerid] = 1;
//FarmerLocked = 0;
SendClientMessage(playerid, COLOR_GREEN, " Your drugs are ready, you can take them when you enter the checkpoint");
return 1;
}
public LockedFarmerField()
{
FarmersLocked = 0;
return 1;
}
Bei Wünschen fertige ich eine Erweiterung an. Auch mit Race Checkpoints.
Have Fun.
Das Script ist schon ewig alt, also^^