Hallöchen popöchen,
zunächst einmal ist mir vollkommen klar, dass folgender Code Quark ist, nur bin ich mir über die Vorgehensweise noch nicht so ganz im Klaren...
new Line1[64];
new Line2[64];
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(cmdtext == "/ls") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/skate") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/bank1") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/bank2") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/transls") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/sc") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/market") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/film") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/lsmc") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/lsa") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/ammuls") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/beach") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/sf") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/sfa") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/bank3") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/ammusf") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/sfm") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/ct") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/mh") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/jizzy") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/pier") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/golfsf") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/lv") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/satellite") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/aa") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/chilliad") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/gfarm") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/gl") TeleportMessages(playerid, cmdtext);
if(cmdtext == "/pine") TeleportMessages(playerid, cmdtext);
}
stock TeleportMessages(playerid, cmdtext[])
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(Line2, sizeof(Line2), Line1)
format(Line1, sizeof(Line1), "%s ~>~ /%s", pName, cmdtext); //cmdtext???
new string[200];
format(string, sizeof(string), "%s~n~%s", Line1, Line2);
TextDrawSetString(TeleportsTD, string);
return 1;
}
Wenn ich es so stehen lasse, bekomme ich jede Menge "array must be indexed (variable "cmdtext")".
Das System sieht folgendermaßen aus.
Das hier...
Manyula ~>~ /LS
* zunächst leerer String*
...wird dazu.
Testperson ~>~ /Chilliad
Manyula ~>~ /LS