Help :( -
New Ilyass - 06.02.2011
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
{
if (strcmp("/makeadmin", cmdtext, true, 10) == 0)
{
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ADMINCOLOR,"USAGE: /makeadmin [playerid] [level]");
SendClientMessage(playerid, ADMINCOLOR, "FUNCTION: Player will be an admin.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, 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, ADMINCOLOR, 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, ADMINCOLOR, string);
}
}
else
{
SendClientMessage(playerid, ADMINCOLOR, "You are not a lead admin!");
}
}
return 1;
}
return 0;
}
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(101) : error 017: undefined symbol "strtok"
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(101) : error 033: array must be indexed (variable "cmd")
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(111) : error 017: undefined symbol "strtok"
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(111) : error 033: array must be indexed (variable "tmp")
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(11

: warning 217: loose indentation
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(11

: error 017: undefined symbol "ReturnUser"
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(119) : error 017: undefined symbol "strtok"
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(119) : error 033: array must be indexed (variable "tmp")
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(132) : warning 217: loose indentation
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(133) : error 029: invalid expression, assumed zero
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(145) : warning 225: unreachable code
D:\DOC ILYASS\SAMP Server\filterscripts\simpleadmin.pwn(100) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
8 Errors.
Re: Help :( -
bartje01 - 06.02.2011
Use zcmd. I'm sure you won't get this errors if you do