Cuff command
#1

Hello
can someone help me when i make my cuff command the i use it on someone
after that it only tells that i am cuffed but i am not i can move
and then when i uncuff myself i see the hand cuffs in one hand

if someone can post his cuff code i will aprricate that
and please give me the codes with zcmd
Reply
#2

Here is mine:
pawn Код:
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Suspect Cuffed_]]");
        format(string,sizeof(string),"You have placed cuffs on %s(%d)! They can no longer move.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
        SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Placed in handcuffs_]]");
        format(string,sizeof(string),"Law enforcement officer %s(%d) has placed you in handcuffs. You can try using /breakcuffs .",PlayerName(playerid),playerid);
        SendClientMessage(ID,COLOR_LIGHTBLUE,string);
        SetPlayerSpecialAction(ID,SPECIAL_ACTION_CUFFED);
        SetPlayerSpecialAction(ID,SPECIAL_ACTION_CUFFED);
        IsCuffed[ID] =1;
        CuffTime[ID] =60;
        TogglePlayerControllable(ID,0);
        SetPlayerAttachedObject(ID, CUFF_SLOT, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
Reply
#3

Can you like make it a full cmd and i tried it and it didnt work
Reply
#4

Command to cuff a player.
Код:
command(cuff, playerid, params[])
{
	if(Player[playerid][Faction] == 1)
	{
	    new id, string[256];
		if(sscanf(params, "u", id)) return SendClientMessage(playerid, WHITE, "Server: /cuff [playerid/name]");
		{
		    if(GetDistanceBetweenPlayers(playerid, id) <= 4.0)
		    {
		        if(PlayerCuffed[id] == 0)
		        {
		        	format(string, sizeof(string), "* %s places %s in handcuffs *", MaskOnOff(playerid), MaskOnOff(id));
		        	CloseMessage(playerid, ACTION, string);
		        	PlayerCuffed[id] = 1;
                	SetPlayerSpecialAction(id, SPECIAL_ACTION_CUFFED);
					TogglePlayerControllable(id, 0);
    	        	SetPlayerAttachedObject(id, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
				}
				else return SendClientMessage(playerid, WHITE, "That player is already cuffed.");
			}
			else return SendClientMessage(playerid, WHITE, "You aren't near that player.");
		}
	}
	else return SendClientMessage(playerid, WHITE, "You aren't in the correct Faction.");
	return 1;
}
Command to uncuff a player.
Код:
command(uncuff, playerid, params[])
{
	if(Player[playerid][Faction] == 1)
	{
		new id, string[256];
		if(sscanf(params, "u", id)) return SendClientMessage(playerid, WHITE, "Server: /uncuff [playerid/name]");
		{
		    if(GetDistanceBetweenPlayers(playerid, id) <= 4.0)
		    {
		        if(PlayerCuffed[id] == 1)
		        {
					format(string, sizeof(string), "* %s takes off %s's handcuffs *", MaskOnOff(playerid), MaskOnOff(id));
					CloseMessage(playerid, ACTION, string);
					PlayerCuffed[id] = 0;
					TogglePlayerControllable(id, 1);
					SetPlayerSpecialAction(id, SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(id, 0);
				}
				else return SendClientMessage(playerid, WHITE, "That player isn't cuffed.");
			}
			else return SendClientMessage(playerid, WHITE, "You aren't near that player.");
		}
	}
	else return SendClientMessage(playerid, WHITE, "YOu aren't in the correct Faction.");
	return 1;
}
Reply
#5

i get this errors
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(399) : error 017: undefined symbol "WHITE"
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(403) : error 017: undefined symbol "PlayerCuffed"
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(403) : warning 215: expression has no effect
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(403) : error 001: expected token: ";", but found "]"
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(403) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(403) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#6

HERE IS Cuff and uncuff cmd code enjoy
Код:
CMD:acuff(playerid,params[])
 {
	new id;
	if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/cuff [ID]");
     new Float:x, Float:y, Float:z;
    	GetPlayerPos(id, x,y,z);
    	PlayerPlaySound(id, 5201, x,y,z);
	    SendClientMessage(id, 0xFF0000AA, "* You are now cuffed.");
		SetPlayerSpecialAction(id, SPECIAL_ACTION_CUFFED);
    	SetPlayerAttachedObject(id, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);

	return 1;
 }
CMD:auncuff(playerid,params[])
{	new id1;
	if(sscanf(params,"u",id1)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/slay [ID]");
		new Float:x, Float:y, Float:z;
    	GetPlayerPos(id1, x,y,z);
    	PlayerPlaySound(id1, 5201, x,y,z);
    	SendClientMessage(id1, 0xFF0000AA, "* You are now uncuffed.");
        for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
        {
        if(IsPlayerAttachedObjectSlotUsed(id1, i)) RemovePlayerAttachedObject(id1, i);
        SetPlayerSpecialAction(id1, SPECIAL_ACTION_NONE);
        }
	return 1;
 }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
 	if(newkeys & KEY_SPRINT && !(oldkeys & KEY_SPRINT) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)