14.01.2014, 13:15
Hey, I am trying to make a player be able to move when we get cuffed but I can't...Can you help me?
CMD:
CMD:
Код:
CMD:cuff(playerid, params[]) { if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pDivision] == 2 || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) { if(GetPVarInt(playerid, "Injured") == 1) { SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now."); return 1; } new string[128], giveplayerid; if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]"); if(IsPlayerConnected(giveplayerid)) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!"); return 1; } if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP) { format(string, sizeof(string), "* You have been handcuffed by %s.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* You handcuffed %s, till uncuff.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s handcuffs %s, tightening the cuffs securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3); TogglePlayerControllable(giveplayerid, 0); ClearAnimations(giveplayerid); ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0,1); PlayerCuffed[giveplayerid] = 2; SetPVarInt(giveplayerid, "PlayerCuffed", 2); SetPVarInt(giveplayerid, "IsFrozen", 1); //Frozen[giveplayerid] = 1; PlayerCuffedTime[giveplayerid] = 300; } else { SendClientMessageEx(playerid, COLOR_GREY, "That player isn't restrained!"); return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you."); return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer."); } return 1; }