PDA

View Full Version : Mega Roleplay [NEED HELP]


James Coral
31/12/2011, 08:59 AM
Hey all ! i have problems with Mega Roleplay!

if i go in Rcon and use /makeadmin then its says "UNAUTHORIZED DO USE"
But i change the command for the Level 1337 and RCON !

Eny Help?

Norck
31/12/2011, 09:19 AM
So you are logged into RCON, but have you made yourself an admin of 1337 lvl before you used this command?

Anyway, post the code of your /makeadmin command here to get more info.

James Coral
31/12/2011, 09:56 AM
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /makeadmin [playerid/PartOfName] [level(1-3)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid)) {
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
//GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("[SERVER]: %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_WHITE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 128, "AdmWarning: %s has set %s to admin level %d.", sendername,giveplayer,level);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}

Norck
31/12/2011, 11:14 AM
According to this code, you can use this command if you logged into RCON or your admin level 1337 or above. And it doesn't works?

James Coral
31/12/2011, 11:34 AM
yeah it dont work :(

Norck
31/12/2011, 12:34 PM
Okay, try to use this command instead of that one that you have. And post here which message do you get after you type it:

if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /makeadmin [playerid/PartOfName] [level(1-3)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
// I've added these lines:
new tmp_str[128];
format(tmp_str,sizeof(tmp_str),"My adm level is: %d, My RCON level is: %d",PlayerInfo[playerid][pAdmin],IsPlayerAdmin(playerid));
SendClientMessage(playerid,-1,tmp_str);
//
if(PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid))
{

if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
//GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("[SERVER]: %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_WHITE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 128, "AdmWarning: %s has set %s to admin level %d.", sendername,giveplayer,level);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}