17.07.2009, 14:00
This may be a little hard to understand...
I've created a working /jail, but, on all my police cmds I have putted ranks, this is a example:
Only Rank 1 may use that cmd.
So by quastion is, how should I put the rank on /jail, it's going to be rank 1.
Thanks
I've created a working /jail, but, on all my police cmds I have putted ranks, this is a example:
Код:
if (strcmp("/check", cmdtext, true, 5) == 0)
{
new str[256], pname[256];
if(PlayerInfo[playerid][pRank] < 1) return SendClientMessage(playerid,0xFF0000FF, "Identification Error - You need LAE Rank 1 to do this.");
if(GetPlayerTeam(playerid) != 5) return SendClientMessage(playerid,0xFF0000FF, "Identification Error - You are not a Police Officer.");
GetPlayerName(playerid, pname, 256);
format(str, 256, "Officer %s Checks him/her for any illegal items!", pname, cmdtext[7]);
SendClientMessageToAll(COLOR_BLUE, str);
return 1;
}
So by quastion is, how should I put the rank on /jail, it's going to be rank 1.
Код:
if(strcmp(cmd, "/jail", true) == 0)
{
if(PlayerToPoint(25.0,playerid,268.3492,77.7623,1001.0391))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [time(minutes)]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (GetPlayerTeam(playerid)==5)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "You were Jailed by %s.", sendername);
SendClientMessage(playa, COLOR_BLUE, string);
ResetPlayerWeapons(playa);
//WantedLevel[playa] = 0;
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
format(string, sizeof(string), "You are jailed for %d minutes.", money);
SendClientMessage(playa, COLOR_BLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Identification Error - You need LAE Rank 1 to do this.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the cells");
}
return 1;
}
return 0;
}

