#include <a_samp>
#include <a_vehicles>
new Checkpoint[MAX_PLAYERS];
new mission[MAX_PLAYERS];
#define COLOR_LIGHTGREEN 0x86FF59FF
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00CA00FF
forward missionfailed(playerid);
public OnFilterScriptInit()
{
//Message in server window
print(" |________________________________|");
print(" |____FilterScript Müllabfuhr ____|");
print(" |____Scripted by AlexandA________|");
// 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);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnGameModeExit() {
return 1;
}
public OnPlayerRequestClass(playerid, classid) {
return 1;
}
public OnPlayerRequestSpawn(playerid) {
return 1;
}
public OnPlayerConnect(playerid) {
SendClientMessage(playerid, COLOR_RED, "Dieser Server nutzt eine Müllabfuhr, tippe in einem Müllauto /starten !");
return 1;
}
public OnPlayerDisconnect(playerid, reason) {
return 1;
}
public OnPlayerSpawn(playerid) {
return 1;
}
public OnPlayerDeath(playerid, killerid, reason) {
return 1;
}
public OnVehicleSpawn(vehicleid) {
return 1;
}
public OnVehicleDeath(vehicleid, killerid) {
return 1;
}
public OnPlayerText(playerid, text[]) {
return 1;
}
public OnPlayerPrivmsg(playerid, recieverid, text[]) {
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
new cmd[256];
new vehicleid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicleid);
if (strcmp("/starten", cmd, true, 5) == 0) {
if(mission[playerid] == 0)
{
if(model == 408)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Muellabfuhr gestartet, fahre nun zu den einzelnen Haeusern!");
SetPlayerCheckpoint(playerid, -74.2252,-1128.7936,1.6359, 5.0);
Checkpoint[playerid] = 1;
mission[playerid] =1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du bist nicht im Muellwagen!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Es laeuft schon eine Mission!");
}
return 1;
}
if (strcmp("/deponie", cmd, true, 5) ==0)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, -546.9002,-488.6077,25.2961);
return 1;
}
}
return 0;
}
public OnPlayerInfoChange(playerid) {
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) {
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid) {
new model = GetVehicleModel(vehicleid);
if(model == 408)
{
if (mission[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "* Du hast 15 Sekunden um zurueck in das Muellauto zu steigen !");
SetTimerEx("missionfailed", 15000, 0,"i",playerid);
}
return 1;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
return 1;
}
public OnPlayerEnterCheckpoint(playerid) {
new trinkgeld = random(85); // Betrag für das Trinkgeld, lässt sich beliebig ändern! ( Zufalls Betrag )
new string[256];
if(Checkpoint[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -89.2432,-1189.7782,2.3241, 5.0);
Checkpoint[playerid] = 2;
}
else if(Checkpoint[playerid] == 2)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -63.3734,-1588.5732,3.1782, 5.0);
Checkpoint[playerid] = 3;
}
else if(Checkpoint[playerid] == 3)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 220.8943,-1393.5308,52.1264, 5.0);
Checkpoint[playerid] = 4;
}
else if(Checkpoint[playerid] == 4)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 169.0361,-1356.8065,69.8208, 5.0);
Checkpoint[playerid] = 5;
}
else if(Checkpoint[playerid] == 5)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 263.5524,-1341.0842,53.7643, 5.0);
Checkpoint[playerid] = 6;
}
else if(Checkpoint[playerid] == 6)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 871.9646,-864.5255,77.2742, 5.0);
Checkpoint[playerid] = 7;
}
else if(Checkpoint[playerid] == 7)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 935.7687,-835.7352,94.4455, 5.0);
Checkpoint[playerid] = 8;
}
else if(Checkpoint[playerid] == 8)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1496.5879,-698.0237,94.5207, 5.0);
Checkpoint[playerid] = 9;
}
else if(Checkpoint[playerid] == 9)
{
SendClientMessage(playerid, COLOR_RED, "Muell aufgeladen, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 1001.1724,-935.0218,41.9509, 5.0);
Checkpoint[playerid] = 10;
}
else if(Checkpoint[playerid] == 10)
{
SendClientMessage(playerid, COLOR_RED, "Das war der letzte fahre nun zurück!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_GREEN, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -546.9002,-488.6077,25.2961, 5.0);
Checkpoint[playerid] = 11;
}
else if(Checkpoint[playerid] == 11)
{
SendClientMessage(playerid, COLOR_RED, "Herzlichen Glueckwunsch, und danke das du hilfst die Stadt sauber zu halten!");
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid, 1975);
SendClientMessage(playerid, COLOR_RED, "Du bekommst einen kleinen Bonus von 1.975$");
mission[playerid] = 0;
}
return 1;
}
public OnPlayerLeaveCheckpoint(playerid) {
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid) {
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid) {
return 1;
}
public OnRconCommand(cmd[]) {
return 1;
}
public OnObjectMoved(objectid) {
return 1;
}
public OnPlayerObjectMoved(playerid, objectid) {
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid) {
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row) {
return 1;
}
public OnPlayerExitedMenu(playerid) {
return 1;
}
public missionfailed(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicleid);
if(model == 408)
{ }
else
{
SendClientMessage(playerid, COLOR_RED, "Muellmission gescheitert!");
DisablePlayerCheckpoint(playerid);
mission[playerid] = 0;
}
return 1;
}
Das is von AlexandA oda so kannst ja als Vorlage nehmen