Hallo Com.,
ich schreibe grade ein Filterscript rund um Waffen - AntiCheat etc.
Jetzt habe ich aber ein Problem bei folgendem Befehl: /disarm.
Ich bekomme 6 Errors, die ich zwar verstehe, aber nicht weiß wie ich sie beseitigen soll.
Ich stelle die Frage jetzt mal an euch
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[30];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/disarm", true) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new giveplayer = strval(tmp);
if(IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(giveplayer))
{
new str[128], sendername[MAX_PLAYER_NAME], giveplayername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayer, giveplayername, sizeof(giveplayername));
format(str, sizeof(str), "AdmCmd:%s have been disarmed by %s!", giveplayername, sendername);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, 0xFFFF00AA, str);
}
}
ResetPlayerWeapons(giveplayer);
SendClientMessage(giveplayer, 0xFFFF00AA, "AdmCmd: You have been disarmed by an Admin!");
}
return 1;
}
else { SendClientMessage(playerid, 0xFFFF00AA, "You aren´t logged in as an Admin!"); }
}
return 1;
}
Errors:
C:\Users\Marcel\Desktop\GameCide[WINDOWS]\filterscripts\anticheat.pwn(65) : error 017: undefined symbol "strtok"
C:\Users\Marcel\Desktop\GameCide[WINDOWS]\filterscripts\anticheat.pwn(65) : error 033: array must be indexed (variable "cmd")
C:\Users\Marcel\Desktop\GameCide[WINDOWS]\filterscripts\anticheat.pwn(70) : error 017: undefined symbol "strtok"
C:\Users\Marcel\Desktop\GameCide[WINDOWS]\filterscripts\anticheat.pwn(70) : error 033: array must be indexed (variable "tmp")
C:\Users\Marcel\Desktop\GameCide[WINDOWS]\filterscripts\anticheat.pwn(64) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.