11.05.2009, 14:50
Quote:
Originally Posted by Weirdosport
The line itself is not the problem, it's where the line is in relation to the lines around it, you'd need to send a bit more.
|
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if (PlayerInfo[playerid][pAdminLevel] == 5 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level 1-5]");
SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin. **PLEASE ENTER THE ID ONLY!**");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[giveplayerid][pAdminLevel] = level;
printf("[ADMIN NEWS]: %s made %s a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, sendername);
SendClientMessage(giveplayerid, LIGHTBLUE, string);
format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][pAdminLevel]);
SendClientMessage(playerid, LIGHTBLUE, string);
}
else if(giveplayerid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, RED, string);
}
}
else
{
SendClientMessage(playerid, RED, "You are not a lead admin!");
}
return 1;
}