08.06.2014, 07:02
hello guys i would like to get some help with /makeadmin command i got errors from there.
/makeadmin
Errors
/makeadmin
pawn Код:
CMD:makeadmin(playerid, params[])
{
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))
{
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
SendClientMessage(playerid, COLOR_WHITE, "FUNCTION: Player will be an admin.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(params, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][AdminLevel] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not that high admin level!");
}
return 1;
}
Код:
C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\pawno\include\YSI\y_ini.inc(1050) : warning 202: number of arguments does not match definition C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(232) : warning 202: number of arguments does not match definition C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(570) : error 017: undefined symbol "idx" C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(577) : error 017: undefined symbol "ReturnUser" C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(578) : error 017: undefined symbol "idx" C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(584) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo" C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(584) : warning 215: expression has no effect C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(584) : error 001: expected token: ";", but found "]" C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(584) : error 029: invalid expression, assumed zero C:\Users\Erik\Desktop\SAMP\Fexterno Gaming DayZ\gamemodes\FreeSoul.pwn(584) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.