26.03.2014, 17:24
Hey guys, I've been trying for 5 days now, to make an arrest command. I have looked on other ppls arrest commands and I have tried to make my own, without any success and I'm getting very frustrated over this.
If you can help me that would be A W E S O M E.
Here's my Cuff and Uncuff cmd:
They work perfectly , Just posted them here if that may help you with helping me, if you need anymore information let me know and I will provide it.
My idea of an /arrest command is that the player will be sent to jail with a timer displayed how long he will stay in there, depending on his wanted level when he got arrested. It will be only for cops to use, ofc and the player must be Cuffed first in order to arrest him. When he has done his time in jail he will respawn outside LSPD.
I have tried to understand others arrest command but I fail at it.
I don't want you to provide me full script for me(unless you want to!). I want you to guide me to make my own as I prefer to learn and not just Copy/paste.
Much thanks in advance!.
If you can help me that would be A W E S O M E.
Here's my Cuff and Uncuff cmd:
pawn Код:
CMD:cuff(playerid, params[])
{
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
new targetid;
if(sscanf(params, "r", targetid)) return SendClientMessage(playerid, -1, " * /cuff Name/ID *");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[60];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), " * You have cuffed %s *",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been cuffed by %s *",name);
SendClientMessage(targetid, 0xE01B1B, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
}
}
return 1;
}
CMD:uncuff(playerid, params[])
{
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
new targetid;
if(sscanf(params, "r", targetid)) return SendClientMessage(playerid, -1, " * /uncuff Name/ID *");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))
return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[60];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), " * You have uncuffed %s *",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been uncuffed by %s *",name);
SendClientMessage(targetid, 0xE01B1B, str);
}
}
return 1;
}
My idea of an /arrest command is that the player will be sent to jail with a timer displayed how long he will stay in there, depending on his wanted level when he got arrested. It will be only for cops to use, ofc and the player must be Cuffed first in order to arrest him. When he has done his time in jail he will respawn outside LSPD.
I have tried to understand others arrest command but I fail at it.
I don't want you to provide me full script for me(unless you want to!). I want you to guide me to make my own as I prefer to learn and not just Copy/paste.
Much thanks in advance!.