19.03.2011, 04:19
See
so i'm scripting an rp server, and it has basic commands etc.
/b works fine.. i have features of it to day like if someone is on admin duty or tester duty
but on problem. When someone is not on testerduty or admin duty, its OK. but when someone is, it says SERVER: Unknown Command. BUT it still shows the message, i mean it shows what you type
anyway here is the pawn code
so i'm scripting an rp server, and it has basic commands etc.
/b works fine.. i have features of it to day like if someone is on admin duty or tester duty
but on problem. When someone is not on testerduty or admin duty, its OK. but when someone is, it says SERVER: Unknown Command. BUT it still shows the message, i mean it shows what you type
anyway here is the pawn code
pawn Код:
if(strcmp(cmd, "/b", true) == 0)//local ooc
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(Mute[playerid] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
return 1;
}
if(AdminDuty[playerid] == 1)
{
format(string, sizeof(string), "(( [Admin Duty] %s says: %s ))", sendername, result);
ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
return 0;
}
else if(TesterDuty[playerid] == 1)
{
format(string, sizeof(string), "(( [Tester Duty] %s says: %s ))", sendername, result);
ProxDetector(20.0, playerid, string,0x990000FF,0x990000FF,0x990000FF,0x990000FF,0x990000FF);
return 0;
}
if(PlayerInfo[playerid][pMaskUse] == 1)
{
format(string, sizeof(string), "(( Stranger_%d Says: %s ))", RandMask[playerid],result);
}
else
{
format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result);
}
if(PlayerInfo[playerid][pAdmin] == 0)
{
SendBMessage(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
else
{
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
}
return 1;
}