Hab mir mal 15 Minuten Zeit genommen:
#include <a_samp>
#define MAX_FLUGHAEFEN 2
new Dodo[MAX_FLUGHAEFEN];
new Shamal[MAX_FLUGHAEFEN];
new Nevada[MAX_FLUGHAEFEN];
enum Check
{
Float:x,
Float:y,
Float:z,
Float:size
};
//Die Flughäfen
new Float:Checkpoints[2][Check] = {
{1576.9788,1391.3984,10.8483, 10.0},
{-1364.0537,-215.1572,14.1484, 10.0}
};
public OnFilterScriptInit()
{
Dodo[0]=1;
Dodo[1]=0;
Shamal[0] = 0;
Shamal[1] = 1;
Nevada[0] = 1;
Nevada[1] = 1;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/work", true))
{
new Float:d = 2000000000.0, id = -1;
for(new i=0; i<MAX_FLUGHAEFEN; i++)
{
new Float:tmp = GetPlayerDistanceFromPoint(playerid, Checkpoints[i][x],Checkpoints[i][y],Checkpoints[i][z]);
if(tmp < d) d = tmp, id = i;
}
if(id == -1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Kein Flughafen gefunden.");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,Checkpoints[id][x],Checkpoints[id][y],Checkpoints[id][z],Checkpoints[id][size]);
new str[144];
format(str, sizeof(str), "Info: Flughafen %d wird angezeigt. Erlaubte Flugzeuge:", id);
SendClientMessage(playerid, 0x00FFFFFF, str);
if(Dodo[id] == 1) format(str, sizeof(str), "Dodo", str);
if(Shamal[id] == 1) format(str, sizeof(str), "%s, Shamal", str);
if(Nevada[id] == 1) format(str, sizeof(str), "%s, Nevada", str);
return SendClientMessage(playerid, 0x00FFFFFF, str);
}
return 0;
}
Falls was am Code unklar ist, frag einfach, ansonsten hoffe ich mal, dass du das verstehst, ist ja nicht so schwer.
Wenn was nicht tut, erklär bitte was nicht funktioniert.