26.03.2014, 19:37
(
Последний раз редактировалось AhmedMohamed; 26.03.2014 в 20:32.
Причина: edited
)
top of the script:
and here is the Stock
Read it well and you will understand.
and the
on the cuff command must be like that
add that in your cuff command
and in your uncuff command add this
pawn Код:
new pCuffed[MAX_PLAYERS];
pawn Код:
CMD:arrest(playerid, params[])
{
new targetid, time, string[128];
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
if(sscanf(params, "ui", targetid, time)) return SendClientMessage(playerid, -1, " * /arrest Name/ID *");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xAFAFAFFF, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, targetid, 2)) return SendClientMessage(playerid, 0xAFAFAFFF, "You are too far away from that player.");
if(!pCuffed(playerid) == 1) return SendClientMessage(playerid, 0xAFAFAFFF, "Player Isn't Cuffed!");
format(str, sizeof(str), " * You have arrested %s *",GetPlayerName(targetid));
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been arrested by %s *",GetPlayerName(playerid));
SendClientMessage(targetid, 0xE01B1B, str);
SetPlayerInterior(targetid, 0);
SetPlayerVirtualWorld(targetid, 0);
SetPlayerPos(targetid, 263.343597, 77.532028, 1001.039062);
RemovePlayerAttachedObject(playerb, 0);
SetTimer("Arrest", time, true);
SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
return 1;
}
pawn Код:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
{
return 1;
}
return 0;
}
and the
pawn Код:
(sscanf(params, "r", targetid))
pawn Код:
if(sscanf(params, "u", targetid))
pawn Код:
pCuffed(playerid) == 1;
pawn Код:
pCuffed(playerid) == 0;