23.01.2013, 08:31
Hello everyone !
I have a little problem by creating a newbie channel for admins/vip (lvl 4)/ and obviously, newbie (age under 1.
So I have this :
But it's not working, when I do /n, it say that I can't access this chat.
What is wrong here ?
Thank you.
I have a little problem by creating a newbie channel for admins/vip (lvl 4)/ and obviously, newbie (age under 1.
So I have this :
pawn Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
//if(PlayerVip[playerid][VipLevel] != 4)
if(PlayerVip[playerid][VipLevel] != 4 && PlayerInfo[playerid][pLevel] > 18 && PlayerInfo[playerid][pAdmin] != 1 && PlayerInfo[playerid][pAdmin] != 2 && PlayerInfo[playerid][pAdmin] != 3 && PlayerInfo[playerid][pAdmin] != 4)
{SendClientMessage(playerid, COLOR_BLUE, "[NewbieChat] You can't access this chat.");return 1;}
//{SendClientMessage(playerid, COLOR_SERVER, noAcces); return 1;}
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "[NewbieChat] You are muted and can't speak.");
return 1;
}
if(nonewbie == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "[NewbieChat] This channel was desactivated by an admin.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_USAGE, "{FF6600}[Action]{99EEFF} (/n)ewbie <Texte>");
return 1;
}
//new paral;
new sendername[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pLevel] < 18) format(string, sizeof(string), "[NewbieChat] Newbie %s: %s", sendername, result);
else if(PlayerVip[playerid][VipLevel] == 4) format(string, sizeof(string), "[NewbieChat] Helper %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] == 1) format(string, sizeof(string), "[NewbieChat] Moderator lv1 %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] == 2) format(string, sizeof(string), "[NewbieChat] Moderator lv2 %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] == 3) format(string, sizeof(string), "[NewbieChat] Administrator %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] == 4) format(string, sizeof(string), "[NewbieChat] Fondator %s: %s", sendername, result);
//else format(string, sizeof(string), "[NewbieChat] Newbie %s: %s", sendername, result);
//{
// SendClientMessage(playerid, COLOR_BLUE, "[NewbieChat] You're 18 years old or more, you can't access this chat anymore.");
// return 1;
//}
//SendClientMessageToAll(COLOR_BLUE, string);
printf("[NewbieChat] %s : %s", playername,result);
}
return 1;
}
But it's not working, when I do /n, it say that I can't access this chat.
What is wrong here ?
Thank you.