"error 033: array must be indexed ( variable "--unknown--")" |
if (sscanf(params, "s", command))
CMD:respawn(playerid, params[]) { if (IsPlayerAdmin(playerid) == 1) { new command; if (sscanf(params, "s", command)) { if (command == "autos") { SendClientMessageToAll(ORANGE, "*** Autos wurden respawnt"); } } SendClientMessage(playerid, RED, "SERVER: Befehl ist noch in Arbeit"); } else { SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt"); } return 1; }
#include <a_samp> #include <zcmdsscanf> #include <dudb> #include <streamer>
CMD:respawn(playerid, params[]) { if (IsPlayerAdmin(playerid) == 1) { new command[64]; if (sscanf(params, "s", command)) { if (!strcmp(command,"autos",true)) { SendClientMessageToAll(ORANGE, "*** Autos wurden respawnt"); } } SendClientMessage(playerid, RED, "SERVER: Befehl ist noch in Arbeit"); } else { SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt"); } return 1; }
if (!strcmp(command,"autos",true)) { SendClientMessageToAll(ORANGE, "*** Autos wurden respawnt"); } else if (!strcmp(command,"server",true)) { SendClientMessageToAll(ORANGE, "*** Server Has been restarted!"); SendRconCommand("gmx"); }
/respawn server
/respawn autos
if (sscanf(params, "s", command)) return SendClientMessage(playerid, RED, "USAGE: /respawn [Autos / Server]"); else if ((strlen(command) != "Autos") ||(strlen(command) != "Server")) return SendClientMessage(playerid, RED, "ERROR: Invalid params!");
Error 033: Array must be indexed (variable "-unknown-") |
if (sscanf(params, "s", command)) return SendClientMessage(playerid, RED, "USAGE: /respawn [befehl]"); else if (strlen(command) != "autos") return SendClientMessage(playerid, RED, "SERVER: Ungьltiger Befehl"); // <--- Error in this line else if (!strcmp(command, "autos", true))
CMD:respawn(playerid, params[])
{
if (IsPlayerAdmin(playerid))
{
if(isnull(params))
{
//message how to use command
}
else if(!strcmp(params,"autos",true))
{
//respawn and whatever
}
else if(!strcmp(params,"something",true))
{
//do something else
}
else
{
//invalid option
}
}
else SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt");
return 1;
}