Guten Tag,
wieso geht dieser befehl nicht?
also wenn ich /sup text eingebe passiert nix sonder es kommt wieder Verwendung: /sup [Text]
hir mein Code:
if(strcmp(cmd, "/sup", true) == 0) {
if(IsPlayerConnected(playerid))
{
new save[512], pname[MAX_PLAYERS], length = strlen(cmdtext), offset = idx, result[64];
GetPlayerName(playerid, pname, sizeof(pname));
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; }
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) {
SCM(playerid, COLOR_GRAD2, "Verwendung: /sup [text]");
return 1;
}
if(TicketAngenommen[playerid] == 0) {
format(save,sizeof save,"Tickets/%s.ini",pname);
if(!dini_Exists(save) && TicketZeile[playerid] == 0) {
new adminmeldung[128];
format(adminmeldung, sizeof(adminmeldung), "%s hat ein Support-Ticket geschrieben", pname);
SAM(COLOR_YELLOW, adminmeldung);
SupportTicket[playerid] = 1;
TicketZeile[playerid] = 1;
dini_Create(save);
dini_Set(save,"Suptext",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast ein Ticket mit folgendem Text geöffnet:");
format(string, sizeof(string), "{33ccff}%s", result);
SCM(playerid, COLOR_YELLOW, string);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT]Warte bis es ein Supporter annimmt!");
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT]Du kannst noch mit /sup 2 weitere Zeilen anhängen");
return 1;
} else if(TicketZeile[playerid] == 1) {
new string2[128];
dini_Set(save, "Suptext2",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
format(string2, sizeof(string2), "%s", result);
SCM(playerid, COLOR_YELLOW, string2);
TicketZeile[playerid] = 2;
return 1;
} else if(TicketZeile[playerid] == 2) {
new string3[128];
dini_Set(save, "Suptext3",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
format(string3, sizeof(string3), "%s", result);
SCM(playerid, COLOR_YELLOW, string3);
TicketZeile[playerid] = 3;
return 1;
} else if(TicketZeile[playerid] == 3) {
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Dein Ticket ist bereits randgefüllt!");
}
} else if(TicketAngenommen[playerid] == 1) {
new pID = DeinSupport[playerid];
new antwort[128], antwort2[128], DerFragende[MAX_PLAYER_NAME], DerSup[MAX_PLAYER_NAME];
GetPlayerName(playerid, DerFragende, sizeof (DerFragende));
GetPlayerName(pID, DerSup, sizeof (DerSup));
format(antwort, sizeof (antwort)," {33ccff}Deine Support-Nachricht: %s", result);
SCM(playerid, COLOR_YELLOW, antwort);
format(antwort2, sizeof (antwort2), "{00ff6e}(( %s: %s ))", DerFragende, result);
SCM(pID, COLOR_YELLOW, antwort2);
}
}
return true;
}
if(IsPlayerConnected(playerid))
{
new save[512], pname[MAX_PLAYERS], length = strlen(cmdtext), offset = idx, result[64];
GetPlayerName(playerid, pname, sizeof(pname));
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; }
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) {
SCM(playerid, COLOR_GRAD2, "Verwendung: /sup [text]");
return 1;
}
if(TicketAngenommen[playerid] == 0) {
format(save,sizeof save,"Tickets/%s.ini",pname);
if(!dini_Exists(save) && TicketZeile[playerid] == 0) {
new adminmeldung[128];
format(adminmeldung, sizeof(adminmeldung), "%s hat ein Support-Ticket geschrieben", pname);
SAM(COLOR_YELLOW, adminmeldung);
SupportTicket[playerid] = 1;
TicketZeile[playerid] = 1;
dini_Create(save);
dini_Set(save,"Suptext",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast ein Ticket mit folgendem Text geöffnet:");
format(string, sizeof(string), "{33ccff}%s", result);
SCM(playerid, COLOR_YELLOW, string);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT]Warte bis es ein Supporter annimmt!");
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT]Du kannst noch mit /sup 2 weitere Zeilen anhängen");
return 1;
} else if(TicketZeile[playerid] == 1) {
new string2[128];
dini_Set(save, "Suptext2",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
format(string2, sizeof(string2), "%s", result);
SCM(playerid, COLOR_YELLOW, string2);
TicketZeile[playerid] = 2;
return 1;
} else if(TicketZeile[playerid] == 2) {
new string3[128];
dini_Set(save, "Suptext3",result);
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Du hast folgendes an dein Ticket anhängt:");
format(string3, sizeof(string3), "%s", result);
SCM(playerid, COLOR_YELLOW, string3);
TicketZeile[playerid] = 3;
return 1;
} else if(TicketZeile[playerid] == 3) {
SCM(playerid, COLOR_YELLOW, "{33ccff}[SUPPORT] Dein Ticket ist bereits randgefüllt!");
}
} else if(TicketAngenommen[playerid] == 1) {
new pID = DeinSupport[playerid];
new antwort[128], antwort2[128], DerFragende[MAX_PLAYER_NAME], DerSup[MAX_PLAYER_NAME];
GetPlayerName(playerid, DerFragende, sizeof (DerFragende));
GetPlayerName(pID, DerSup, sizeof (DerSup));
format(antwort, sizeof (antwort)," {33ccff}Deine Support-Nachricht: %s", result);
SCM(playerid, COLOR_YELLOW, antwort);
format(antwort2, sizeof (antwort2), "{00ff6e}(( %s: %s ))", DerFragende, result);
SCM(pID, COLOR_YELLOW, antwort2);
}
}
return true;
}