02.12.2010, 18:57
I have a problem . I edited everything good with no errors , but in game i am a cop and if i tipe /takedrugs it keeps saying : "Error: Cops only for this feature!" , and i puted myself cop sking , cop team and the rank 1 . What's the problem ! Here's the command :
Help me please !
pawn Код:
if(strcmp(cmd, "/takedrugs", true) == 0 || strcmp(cmd, "/td", true) == 0)
{
format(string, sizeof(string), "Command: %s: %s", sendername2, cmdtext);
SendCmdMessage(COLOR_YELLOW, string);
if (PlayerLoggedIn[playerid] != 1)
{
SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in");
return 1;
}
if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] == TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "Error: Cops only for this feature!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "Usage: /takedrugs [playerid]");
return 1;
}
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "Command: %s: %s", sendername2, cmdtext);
SendCmdMessage(COLOR_YELLOW, string);
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
format(string, sizeof(string), "* You have taken away %s's Drugs.", giveplayer);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "* Officer %s has taken away your Drugs.", sendername);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
PlayerInfo[giveplayerid][pDrugs] = 0;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: That player is not near you !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: That player is Offline !");
return 1;
}
}