21.07.2009, 11:14
I've maked a /cuff cmd, it works to cuff people but...
I want a rank connected to it, I have already connected the team to it, but on all my cop cmd's I got a rank connected.
I'm using ranks like this:
Here is my /cuff command:
So, how should I put a rank in to this command?
Thanks
I want a rank connected to it, I have already connected the team to it, but on all my cop cmd's I got a rank connected.
I'm using ranks like this:
Код:
PlayerInfo[playerid][pRank] < 1)
Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerTeam(playerid)==11)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(playerid)==11)
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Cops !");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Cuff yourself!"); return 1; }
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Cuffed by %s, till uncuff.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You Cuffed %s, till uncuff.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0);
ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 300;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop !");
}
}
return 1;
}
Thanks


