CMD:cuff(playerid, params[]) { if(IsACop(playerid) || Team_EDLS(playerid) && PlayerInfo[playerid][pDivision] == 2 || Team_EDLS(playerid) && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2)) { 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; }
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x3,Float:y3,Float:z3;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x3,y3,z3);
return floatsqroot(floatpower(floatabs(floatsub(x3,x1)),2)+floatpower(floatabs(floatsub(y3,y1)),2)+floatpower(floatabs(floatsub(z3,z1)),2));
}
CMD:cuff(playerid, params[])
{
new string[128], targetid;
if(IsCop[playerid] == false) return SendClientMessage(playerid, COLOR_WHITE, "Error: Only Cops can use this command");
if(sscanf(params, "u", targetid))return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cuff [playerid/name]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_WHITE, "Error: This player is not Connected!");
if(targetid == playerid) return SendClientMessage(playerid,COLOR_WHITE,"Error: You cannot cuff yourself!");
if(GetDistanceBetweenPlayers(playerid,targetid) > 3) return SendClientMessage(playerid, COLOR_WHITE, "Error: You are not close enough to this player!");
if(Cuffed[targetid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Error: This Player Is Already Handcuffed.");
SetPlayerSpecialAction(targetid, SPECIAL_ACTION_CUFFED);
ApplyAnimation(targetid,"ped","WEAPON_crouch",4.1,1,0,0,0,0,1);
Cuffed[targetid] = 1;
return 1;
}
if(PlayerCuffed[giveplayerid] == 1 || GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
Delete this and the closing '}' ith the else:
pawn Код:
|
error 029: invalid expression, assumed zero
else { SendClientMessageEx(playerid, COLOR_GREY, "That player isn't restrained!"); return 1; } }
CMD:cuff(playerid, params[])
{
if(IsACop(playerid) || Team_EDLS(playerid) && PlayerInfo[playerid][pDivision] == 2 || Team_EDLS(playerid) && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2))
{
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)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
if(!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot cuff yourself!");
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 return SendClientMessageEx(playerid, COLOR_GREY, "You're not a law enforcement officer.");
return 1;
}
CMD:cuff(playerid, params[])
{
if(IsACop(playerid))
{
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, "i", 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; }
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);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
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;
}