Hallo liebes forum.
ich bräuchte einmal eure hilfe,
Es geht hier rum
error 021: symbol already defined: "strtok"
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
strtok(const string[], &index)
{ <-#
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
Fehler-> return result;
}
if(strcmp(cmd, "/accban", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
-> giveplayer = strtok(cmdtext, idx);
if(!strlen(giveplayer))
{
SendClientMessage(playerid,COLOR_GRAD2,"FEHLER: /accban [AccountName] (Korrekte Schreibweise erforderlich)");
return 1;
}
new acc[64], acc2[64], year, month, day, readstr[128];
format(acc,sizeof(acc),"/Accounts/%s.ini",giveplayer);
format(acc2,sizeof(acc2),"/Accounts/%s.backup",giveplayer);
if(!fexist(acc))
{
format(string,sizeof(string)," Der Account von %s existiert nicht!",giveplayer);
SendClientMessage(playerid,COLOR_GRAD2,string);
return 1;
}
new File:account = fopen(acc,io_read);
new File:backup = fopen(acc2,io_write);
while(fread(account,readstr))
{
fwrite(backup,readstr);
}
fclose(backup);
fclose(account);
new File:banaccount = fopen(acc,io_write);
fwrite(banaccount,"Level=-999\n");
fclose(banaccount);
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s's Account wurde von %s gebannt! (%d-%d-%d)",giveplayer,sendername,month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s's Account wurde von %s gebannt!",giveplayer,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
return 1;
}