15.03.2009, 22:04
ok, i got a /gov command that kinda works. but it says "You Are Not A FBI Agent" even when they are
i thought it was
and i tried removing that, and gave me abunch of errors
Код:
if(strcmp(cmd, "/gov", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pMember]==2)
{
SendClientMessage(playerid, COLOR_GREY, " You Not A FBI Agent !");
return 1;
}
if(PlayerInfo[playerid][pRank] < 5)
{
SendClientMessage(playerid, COLOR_GREY, " You need to be Rank 5 to be able to use this !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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: (/gov)ernment [text]");
return 1;
}
SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Announcement ___________|");
format(string, sizeof(string), "Goverment Offical %s: %s", sendername, result);
SendClientMessageToAll(COLOR_DBLUE, string);
}
return 1;
}
Код:
if(PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pMember]==2)
{
SendClientMessage(playerid, COLOR_GREY, " You Not A FBI Agent !");
return 1;
}

