How can i fix this cmd?
#1

There is something wrong in this code. If i typ /makeadmin (my own id) 3 then it says 255 is not connected

Can anybody tell me whats wrong?

Quote:

if(strcmp(cmd, "/makeadmin", true) == 0)
{
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD, "USAGE: /makeadmin [playerid] [level]");
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));
adminlevel[giveplayerid] = 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,adminlevel[giveplayerid]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}
}
else
{
SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
}
return 1;
}

Reply


Messages In This Thread
How can i fix this cmd? - by Battlaman - 28.08.2009, 18:22
Re: How can i fix this cmd? - by StrickenKid - 28.08.2009, 19:52
Re: How can i fix this cmd? - by Dark_Kostas - 28.08.2009, 19:54
Re: How can i fix this cmd? - by StrickenKid - 28.08.2009, 20:02
Re: How can i fix this cmd? - by Battlaman - 28.08.2009, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)