06.02.2014, 20:23
(
Последний раз редактировалось CallumDaBest; 06.02.2014 в 20:28.
Причина: Title
)
There is an error with this code:
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /makeadmin [playerid/PartOfName] [Admin Rank]");
SendClientMessage(playerid, COLOR_YELLOW, "(0) Remove Admin Status");
SendClientMessage(playerid, COLOR_YELLOW, "(1) Moderator");
SendClientMessage(playerid, COLOR_YELLOW, "(2) Junior Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(3) General Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(4) Senior Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(1337) Head Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(133 Co-Community Owner");
SendClientMessage(playerid, COLOR_YELLOW, "(1339) Co-Community Owner");
SendClientMessage(playerid, COLOR_YELLOW, "(99999) Community Owner");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 99999 || strcmp(sendername, "Callum_Riley", true) == 0)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("{AA3333}AdmCmd{FFFF00}: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
This is the error message:
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(547 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(549 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(552 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(564 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(568 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(571 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(573 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(575 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(588 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(593 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(595 ) : warning 203: symbol is never used: "level"
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(595 ) : warning 203: symbol is never used: "para1"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
10 Errors.
Can someone please fix it!
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /makeadmin [playerid/PartOfName] [Admin Rank]");
SendClientMessage(playerid, COLOR_YELLOW, "(0) Remove Admin Status");
SendClientMessage(playerid, COLOR_YELLOW, "(1) Moderator");
SendClientMessage(playerid, COLOR_YELLOW, "(2) Junior Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(3) General Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(4) Senior Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(1337) Head Admin");
SendClientMessage(playerid, COLOR_YELLOW, "(133 Co-Community Owner");
SendClientMessage(playerid, COLOR_YELLOW, "(1339) Co-Community Owner");
SendClientMessage(playerid, COLOR_YELLOW, "(99999) Community Owner");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 99999 || strcmp(sendername, "Callum_Riley", true) == 0)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("{AA3333}AdmCmd{FFFF00}: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
This is the error message:
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(547 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(549 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(552 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(564 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(568 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(571 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(573 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(575 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(588 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(593 ) : error 010: invalid function or declaration
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(595 ) : warning 203: symbol is never used: "level"
C:\Users\Gamer\Desktop\good\gamemodes\test.pwn(595 ) : warning 203: symbol is never used: "para1"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
10 Errors.
Can someone please fix it!