10.05.2010, 02:07
Hello AGAIN! I have this, (credits to Raven's Role Play)
but every time I type
and I am an Admin, it doesn't work... Why not?
Thanks again!
*Again: Credits to GodFather and Raven's Role Play*
pawn Код:
if(strcmp(cmd, "//", true) == 0 || strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "@", true) == 0)
{
if(IsPlayerConnected(playerid))
{
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: // [chat message], @ [chat message] or /admin [chat message]");
return 1;
}
new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Junior Mod"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Moderator"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Senior Mod"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Junior Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Senior Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 1337) { arank = "Co-Owner"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 1338) { arank = "Owner"; } //By: Nick Piccoli
else { arank = "Unknown"; }
format(string, sizeof(string), " [%s] %s (%d): %s", arank, sendername, playerid, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_LIGHTRED, string);
}
printf("Admin %s: %s", sendername, result);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Admin %s: %s",d,m,y,h,mi,s,sendername, result);
AdminChatLog(string);
}
return 1;
}
if(strcmp(cmd, "///", true) == 0 || strcmp(cmd, "/tester", true) == 0 || strcmp(cmd, "#", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1 )
{
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: /// [chat message], # [chat message] or /tester [chat message]");
return 1;
}
new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Junior Mod"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Moderator"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Senior Mod"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Junior Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Senior Admin"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 1337) { arank = "Co-Owner"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pAdmin] == 1338) { arank = "Owner"; } //By: Nick Piccoli
else if(PlayerInfo[playerid][pTester] == 3) { arank = "Lead Tester"; }
else if(PlayerInfo[playerid][pTester] == 2) { arank = "Tester"; }
else if(PlayerInfo[playerid][pTester] == 1) { arank = "Junior Tester"; }
else { arank = "Unknown"; }
format(string, sizeof(string), " [%s] %s (%d): %s", arank, sendername, playerid, result);
SendTesterAdminMessage(COLOR_YELLOW, string);
printf("Tester %s: %s", sendername, result);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Tester %s: %s",d,m,y,h,mi,s,sendername, result);
AdminChatLog(string);
}
}
return 1;
}
pawn Код:
@[message] or #[message]
Thanks again!
*Again: Credits to GodFather and Raven's Role Play*