Ich habe [ FILTERSCRIPT ] Paperboy
mit dem Timer von einem Bankrob-FS ausgestattent.
#include <a_samp>
#include <a_vehicles>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define robtime 500000 // XXZeit wielange man nicht Austragen darf 3000000 = 30 Minuten
new rob = 0; //XX
new Checkpoint[MAX_PLAYERS];
new bool:mission[MAX_PLAYERS];
new trashcars[4];
forward missionfailed(playerid);
forward TRASHCAR(carid);
forward robtimer(); //XXtimer
#define RESPAWN 60000
#define ENTGELD 50
#define COLOR_WHITE 0xFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00CA00FF
enum XYZR {
Float:X,
Float:Y,
Float:Z,
Float:R
}
new
Checkpoints[9][XYZR] = {
{161.04,-112.14,4.89, 6.0},//1
{206.61,-111.66,4.89, 6.0},//2
{251.75,-121.41,3.51, 6.0},//3
{204.01,-30.73,1.18, 6.0},//4
{338.53,58.35,3.28, 6.0},//5
{287.49,30.11,2.16, 6.0},//6
{291.03,-194.71,1.18, 6.0},//7
{291.72,-62.71,1.18, 6.0},//8
//{932.8849,-1801.2341,13.3377, 6.0},//9
//{1380.7908,-1753.7823,13.1190, 6.0},//10
{158.49,-22.26,1.57, 6.0} // 11
};
public OnFilterScriptInit()
{
print("|>-------------------<|");
print("Paperboy by [AuX]Raphii");
print("|>-------------------<|");
//==============> Fahrräder <==============
trashcars[0] = CreateVehicle(510,158.49,-22.26,1.57,270,0,0, RESPAWN);
//trashcars[1] = CreateVehicle(510,1668.3710,-1903.2706,13.5469,354.5750,0,0, RESPAWN);
//trashcars[2] = CreateVehicle(510,1666.2471,-1902.9926,13.5469,15.1827,0,0, RESPAWN);
//trashcars[3] = CreateVehicle(510,1664.6052,-1903.9373,13.5469,23.9561,0,0, RESPAWN);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnGameModeExit() {
return 1;
}
public OnPlayerRequestClass(playerid, classid) {
return 1;
}
public OnPlayerRequestSpawn(playerid) {
return 1;
}
public OnPlayerConnect(playerid)
{
mission[playerid] = false;
Checkpoint[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(austragen, 9, cmdtext);
dcmd(rconzeitungen, 13, cmdtext);
return 0;
}
dcmd_austragen(playerid, params[])
{
#pragma unused params
if(mission[playerid] == true) { return SendClientMessage(playerid, COLOR_RED, "Es laeuft schon eine Mission!"); }
if(rob)
{
SendClientMessage(playerid,0xAA3333AA,"Du musst noch bis zu 5 Minuten warten!");
return 1;
}
if(!TRASHCAR(GetPlayerVehicleID(playerid)))
{ SendClientMessage(playerid, COLOR_RED, "Du bist nicht auf dem Fahrrad!");return 1; }
else{
Checkpoint[playerid]=0;
mission[playerid] = true;
SendClientMessage(playerid, COLOR_WHITE, "Fahre nun zu den einzelnen Häuser und gib die Zeitungen ab. Sie sind rot auf deiner Karte markiert!");
SetPlayerCheckpoint(playerid,Checkpoints[0][X],Checkpoints[0][Y],Checkpoints[0][Z],Checkpoints[0][R]);
return 1;
}
}
dcmd_rconzeitungen(playerid, params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) { return SendClientMessage(playerid, COLOR_RED, "Du musst als Admin eingeloggt sein."); }
SetPlayerPos(playerid, 162.78,-26.47,1.57);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if (mission[playerid] && TRASHCAR(vehicleid))
{
SendClientMessage(playerid, COLOR_RED, "* Du hast 15 Sekunden um zurueck auf das Fahrrad zu steigen !");
SetTimerEx("missionfailed", 15000, 0,"d",playerid);
return 1;
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if (mission[playerid] == true){
new
trinkgeld,
string[128];
trinkgeld = random(3);
Checkpoint[playerid] ++;
if(Checkpoint[playerid] < (sizeof(Checkpoints)))
{
SendClientMessage(playerid, COLOR_WHITE, "Zeitung abgegeben, weiter!");
GivePlayerMoney(playerid, trinkgeld);
format(string, sizeof(string), "** Du hast %d$ Trinkgeld bekommen!",trinkgeld);
SendClientMessage(playerid, COLOR_WHITE, string);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, Checkpoints[Checkpoint[playerid]][X],Checkpoints[Checkpoint[playerid]][Y],Checkpoints[Checkpoint[playerid]][Z],Checkpoints[Checkpoint[playerid]][R]);
}
else if(Checkpoint[playerid] == (sizeof(Checkpoints)))
{
SendClientMessage(playerid, COLOR_GREEN, "Vielen Dank für dein Engagement als Austraeger.");
DisablePlayerCheckpoint(playerid);
format(string, 128, "Dein Verdienst sind $%d", ENTGELD);
SendClientMessage(playerid, COLOR_GREEN, string);
mission[playerid] = false;
Checkpoint[playerid] = 0;
GivePlayerMoney(playerid, ENTGELD);
rob = 1; //XX
SetTimer("robtimer",robtime,0); //XX
}}
return 1;
}
public missionfailed(playerid)
{
if(!TRASHCAR(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid, COLOR_RED, "Du hast die Zeitungen verloren!");
DisablePlayerCheckpoint(playerid);
mission[playerid] = false;
Checkpoint[playerid] = 0;
}
return 1;
}
public TRASHCAR(carid)
{
for(new i = 0; i < sizeof(trashcars); i++)
{
if(carid == trashcars[i])
{
return 1;
}
}
return 0;
}
public robtimer() //XX
{
rob = 0;}
Problem: Wenn ich jetzt /austragen mache, startet die Mission, egal ob ich aufm Fahrrad bin oder nicht . Was hab ich falsch gemacht?