I try but that not working if you edit i Understand that. Without not need //
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
#include zcmd
#include sscanf
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Handcuff System by Tee ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_ANALOG_RIGHT, newkeys, oldkeys))
{
new id,Cuff[MAX_PLAYERS],Name[MAX_PLAYER_NAME],string[MAX_PLAYERS],pskin = GetPlayerSkin(playerid);
for (new i=0; i<MAX_PLAYERS; i++){
if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288){
if(id == playerid)return SendClientMessage(playerid,0xC0C0C0FF,"**You cannot cuff yourself.");
if(GetDistanceBetweenPlayers(playerid,id)> 2)return SendClientMessage(playerid,0xC0C0C0FF,"You are to far from that player");
}else return SendClientMessage(playerid,0xC0C0C0FF,"You dont have permisson to access this command.");
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED );// zaidejo animacija[Rankos uz nugaros]
SetPlayerAttachedObject(playerid,0,19418,5,0.016000,0.032000,0.025000,17.500005,-10.099991,-48.099990,1.0,1.0,1.0 );//Zaidejui uzdedami antrankiai
TogglePlayerControllable(id,false);
}
{
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "You have been restrained in handcuffs by %s.",Name);
}SendClientMessage(i,0xFF0000FF,string);
}
Cuff[id] = 1;
return 1;
}
if(PRESSED(KEY_ANALOG_LEFT, newkeys, oldkeys))
{
new id,Cuff[MAX_PLAYERS],Name[MAX_PLAYER_NAME],string[MAX_PLAYERS],pskin = GetPlayerSkin(playerid);
for (new i=0; i<MAX_PLAYERS; i++){
if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288){
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xC0C0C0FF,"**You can't uncuff someone from a vehicle.");
if(id == playerid)return SendClientMessage(playerid,0xC0C0C0FF,"**You cannot uncuff yourself.");
if(GetDistanceBetweenPlayers(playerid,id)> 2)return SendClientMessage(playerid,0xC0C0C0FF,"You are to far from that player");
}else return SendClientMessage(playerid,0xC0C0C0FF,"You dont have permisson to access this command.");
{
RemovePlayerAttachedObject(playerid,0); //Panaikina antrankius
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);// Nustato ,kad nebutu
TogglePlayerControllable(id,true);
}
{
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "Your handcuffs have been removed by %s.",Name);
}SendClientMessage(i,0xFF0000FF,string);
}
Cuff[id] = 0;
return 1;
}
return 1;
}
//-------------------------------DISTANCE-------------------------------------//
stock GetDistanceBetweenPlayers(playerid,playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}