15.03.2014, 02:13
Hello i created a /(a)dmin command. But when i compile i get some errors ¤_¤
This is the code:
This is the errors i get:
This is the code:
pawn Код:
CMD:admin(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
return 1;
}
new atext[60];
if(Player[playerid][AdminLevel] == 1)
{
atext = "Junior Moderator";
}
if(Player[playerid][AdminLevel] == 2)
{
atext = "Moderator";
}
if(Player[playerid][AdminLevel] == 3)
{
atext = "Lead Moderator";
}
if(Player[playerid][AdminLevel] == 4)
{
atext = "Junior Administrator";
}
if(Player[playerid][AdminLevel] == 5)
{
atext = "Administrator";
}
if(Player[playerid][AdminLevel] == 6)
{
atext = "Lead Administrator";
}
if(Player[playerid][AdminLevel] == 7)
{
atext = "Owner";
}
format(string, sizeof(string), "[%s] %s (%d):"COL_WHITE " %s", atext, RemoveUnderScore(playerid), playerid, result);
if(Player[playerid][AdminLevel] >= 1)
{
SendAdminMessage(COLOR_NICEGREEN, string);
}
}
return 1;
}
pawn Код:
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "idx"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line