21.07.2009, 11:40
100$ that's copypasted from godfather, please stop doing that and try coding yourself. It's horrible the way it is coded, I took some time and made it hawter. (my style)
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp);
if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
if (GetPlayerTeam(playerid) != 11) return SendClientMessage(playerid, COLOR_GREY, " You ain't no cop!");
if (PlayerInfo[playerid][pRank] < 1) return SendClientMessage(playerid, COLOR_GREY, " Your rank is too low!");
if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !");
if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
if (GetPlayerTeam(giveplayerid) == 11) return SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Cops !");
if (giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, " Invalid player! !");
if (giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, " You cannot Cuff yourself!");
if (ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
{
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;
}
return 1;
}