SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/05/2012, 05:47 PM   #1
tiernantheman
Huge Clucker
 
tiernantheman's Avatar
 
Join Date: Dec 2011
Location: Republic Of Ireland
Posts: 461
Reputation: 70
Default 0.3e Cuff system help REP+

Hello, can anybody tell me the coding to make the new cuff system in 0.3e? like the hands behind their back and when you jump in cuffs you fall and other stuff regarding it? thanks
__________________

Returning to SA:MP, Divinity Roleplay will have a much more advanced script allowing players to roleplay in a nice country enviorment in the towns of Bayside, El Quebrados and Las Payadas!
tiernantheman is offline   Reply With Quote
Old 09/05/2012, 05:59 PM   #2
Kudoz
Huge Clucker
 
Kudoz's Avatar
 
Join Date: Feb 2012
Location: Norway
Posts: 314
Reputation: 23
Default Re: 0.3e Cuff system help REP+

Put this whereever you want it.. (or not really) but you can make a cmd out of it.

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
__________________
Kudoz™





www.volt-host.com/donation/Kudoz/
Kudoz is offline   Reply With Quote
Old 09/05/2012, 06:03 PM   #3
HDFord
Big Clucker
 
HDFord's Avatar
 
Join Date: Aug 2011
Location: Grønvollfoss in Norway with a shotgun
Posts: 168
Reputation: 18
Default Re: 0.3e Cuff system help REP+

This should work as a command i think
pawn Code:
CMD:cuff(playerid,params[])
{
    new id;
    if(sscanf(params,"u",id))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Usage: /cuff <id>");
    }
    }
    else if(id == INVALID_PLAYER_ID)
    {
        SendClientMessage(playerid,0xFFFFFFFF,"that player is not online");
    }
    else
    {
        new name[MAX_PLAYER_NAME],string[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],string2[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
        format(string,sizeof(string),"You have been cuffed by %s.",name);
        SendClientMessage(id,0xFFFFFFFF,string);
        GetPlayerName(id,name2,sizeof(name2));
        format(string2,sizeof(string2),"You cuffed %s.",name2);
        SendClientMessage(playerid,0xFFFFFFFF,string2);
        SetPlayerSpecialAction(id,SPECIAL_ACTION_CUFFED);
    }
    return 1;
}
__________________
If you cannot script it yourself learn it or leave it!!!
Want me to make a tut? Feel free to ask


Code:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
HDFord is offline   Reply With Quote
Old 09/05/2012, 06:06 PM   #4
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,529
Reputation: 61
Default Re: 0.3e Cuff system help REP+

pawn Code:
}
    if(strcmp(cmd, "/cuff", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pFaction] == 3)
            {
                if(CopOnDuty[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You are not on duty");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cuff [playerid]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(PlayerCuffed[giveplayerid] == 1)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "That player is already cuffed");
                            return 1;
                        }
                        if(giveplayerid == playerid)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "You can not cuff yourself");
                            return 1;
                        }
                        if(ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            format(string, sizeof(string), "You have been cuffed by %s", GetPlayerNameEx(playerid));
                            SendClientMessage(giveplayerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "You have cuffed %s", GetPlayerNameEx(giveplayerid));
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            PlayerCuffed[giveplayerid] = 1;
                            SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
                            SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                            PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"cuffs");
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Invalid faction");
            }
        }
        return 1;
N0FeaR is offline   Reply With Quote
Old 09/05/2012, 06:35 PM   #5
tiernantheman
Huge Clucker
 
tiernantheman's Avatar
 
Join Date: Dec 2011
Location: Republic Of Ireland
Posts: 461
Reputation: 70
Default Re: 0.3e Cuff system help REP+

Anyone got a code for /uncuff so that it removes the cuffs when I do /uncuff?
__________________

Returning to SA:MP, Divinity Roleplay will have a much more advanced script allowing players to roleplay in a nice country enviorment in the towns of Bayside, El Quebrados and Las Payadas!
tiernantheman is offline   Reply With Quote
Old 09/05/2012, 06:55 PM   #6
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,529
Reputation: 61
Default Re: 0.3e Cuff system help REP+

Code:
}
 	if(strcmp(cmd, "/uncuff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pFaction] == 1|| PlayerInfo[playerid][pFaction] == 0)
			{
   				if(CopOnDuty[playerid] == 0)
			    {
			    	SendClientMessage(playerid, COLOR_GREY, "You are not on duty");
			        return 1;
			    }
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /uncuff [playerid]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
			    if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
					    if(PlayerCuffed[giveplayerid] == 0)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "That player is not cuffed");
					        return 1;
					    }
 			    		if(giveplayerid == playerid)
				    	{
        					SendClientMessage(playerid, COLOR_GREY, "You can not uncuff yourself");
        					return 1;
				    	}
						if(ProxDetectorS(8.0, playerid, giveplayerid))
						{
        					format(string, sizeof(string), "You have been uncuffed by %s", GetPlayerNameEx(playerid));
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
							format(string, sizeof(string), "You have uncuffed %s", GetPlayerNameEx(giveplayerid));
							SendClientMessage(playerid, COLOR_WHITE, string);
							PlayerCuffed[giveplayerid] = 0;
							SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(giveplayerid,0);
							PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs");
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "Invalid faction");
			}
		}
		return 1;
N0FeaR is offline   Reply With Quote
Old 09/05/2012, 07:03 PM   #7
tiernantheman
Huge Clucker
 
tiernantheman's Avatar
 
Join Date: Dec 2011
Location: Republic Of Ireland
Posts: 461
Reputation: 70
Default Re: 0.3e Cuff system help REP+

Quote:
Originally Posted by N0FeaR View Post
Code:
}
 	if(strcmp(cmd, "/uncuff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pFaction] == 1|| PlayerInfo[playerid][pFaction] == 0)
			{
   				if(CopOnDuty[playerid] == 0)
			    {
			    	SendClientMessage(playerid, COLOR_GREY, "You are not on duty");
			        return 1;
			    }
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /uncuff [playerid]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
			    if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
					    if(PlayerCuffed[giveplayerid] == 0)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "That player is not cuffed");
					        return 1;
					    }
 			    		if(giveplayerid == playerid)
				    	{
        					SendClientMessage(playerid, COLOR_GREY, "You can not uncuff yourself");
        					return 1;
				    	}
						if(ProxDetectorS(8.0, playerid, giveplayerid))
						{
        					format(string, sizeof(string), "You have been uncuffed by %s", GetPlayerNameEx(playerid));
							SendClientMessage(giveplayerid, COLOR_WHITE, string);
							format(string, sizeof(string), "You have uncuffed %s", GetPlayerNameEx(giveplayerid));
							SendClientMessage(playerid, COLOR_WHITE, string);
							PlayerCuffed[giveplayerid] = 0;
							SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
							RemovePlayerAttachedObject(giveplayerid,0);
							PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs");
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "Invalid faction");
			}
		}
		return 1;
Thanks mate REP+
__________________

Returning to SA:MP, Divinity Roleplay will have a much more advanced script allowing players to roleplay in a nice country enviorment in the towns of Bayside, El Quebrados and Las Payadas!
tiernantheman is offline   Reply With Quote
Old 10/05/2012, 11:58 AM   #8
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,529
Reputation: 61
Default Re: 0.3e Cuff system help REP+

No problem, ask me if you need more help.
N0FeaR is offline   Reply With Quote
Old 10/05/2012, 01:56 PM   #9
tiernantheman
Huge Clucker
 
tiernantheman's Avatar
 
Join Date: Dec 2011
Location: Republic Of Ireland
Posts: 461
Reputation: 70
Default Re: 0.3e Cuff system help REP+

Quote:
Originally Posted by N0FeaR View Post
No problem, ask me if you need more help.
Hmmm, do you know the jump thing with the cuffing system like if you jump you fall got any idea how I can do that?
__________________

Returning to SA:MP, Divinity Roleplay will have a much more advanced script allowing players to roleplay in a nice country enviorment in the towns of Bayside, El Quebrados and Las Payadas!
tiernantheman is offline   Reply With Quote
Old 13/05/2012, 01:12 AM   #10
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,529
Reputation: 61
Default Re: 0.3e Cuff system help REP+

Place this under
OnPlayerKeyStateChange

pawn Code:
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);
N0FeaR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Tazer/Cuff/Drag system good for RP JhnzRep Filterscripts 8 29/03/2013 09:45 PM
/cuff James_Bourne Help Archive 1 11/08/2011 08:37 AM
HELP NEED /CUFF ironmenpr17 Help Archive 2 28/05/2011 03:23 AM
Cuff Tell Cop hector_williams Help Archive 1 20/12/2009 01:05 AM


All times are GMT. The time now is 09:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.