SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 25/05/2010, 10:50 PM   #1
JustinB
Big Clucker
 
Join Date: Apr 2010
Posts: 71
Reputation: 1
Default Make So Can't Move when Cuffed

Hey Guys I'm trying to make it so if player's do /stuck It doesn't let them move IF They ARE Cuffed. Right now the /stuck command is supposed to unfreeze them when they are frozen,I made it so they can't move while they are frozen either. But when I try it when they are cuffed they get unfrozen anyways.
So what I'm trying to do is make it so a message pop's up so if they are cuffed it will say:You Are Cuffed you can't Unfreeze yourself!
Here's the code,Thanks For all Your help

Code:
if(strcmp(cmd, "/stuck", true) == 0)
  {
    if(IsPlayerConnected(playerid))
    {
      if(PlayerInfo[playerid][pFrozen] == 1)
			{
			  SendClientMessage(playerid, COLOR_GREY, "You were frozen by an admin, you can't evade that!");
				return 1;
			}
      else if(PlayerCuffed[giveplayerid] > 0)
			{
			  SendClientMessage(playerid, COLOR_GREY, "You Are HandCuffed,You Can't Evade That!");
        TogglePlayerControllable(giveplayerid, 0);
				return 1;
			}
			TogglePlayerControllable(playerid, 1);
      new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stuck",d,m,y,h,mi,s,sendername);
			AdminLog(string);
		}
		return 1;
	}
JustinB is offline  
Old 25/05/2010, 11:07 PM   #2
Anthony_Brassi
Big Clucker
 
Join Date: Jun 2009
Posts: 127
Reputation: 0
Default Re: Make So Can't Move when Cuffed

do

if(PlayerCuffed == 1)
{
Blah
}


EDIT: I see your problem, do

else if(PlayerCuffed[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "You Are HandCuffed,You Can't Evade That!");
TogglePlayerControllable(playerid, 0);
return 1;
}
not giveplayerid, and i don't think you need else if
do if()
(Not sure)
Anthony_Brassi is offline  
Old 26/05/2010, 01:39 AM   #3
Lilcuete
Gangsta
 
Join Date: Sep 2009
Posts: 568
Reputation: 1
Default Re: Make So Can't Move when Cuffed

Quote:
Originally Posted by Anthony_Brassi
do

if(PlayerCuffed == 1)
{
Blah
}


EDIT: I see your problem, do

else if(PlayerCuffed[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "You Are HandCuffed,You Can't Evade That!");
TogglePlayerControllable(playerid, 0);
return 1;
}
not giveplayerid, and i don't think you need else if
do if()
(Not sure)

Yea that is right theres no need to use giveplayerid unless its /stuck [playerid] then you will need to use giveplayerid.
Lilcuete is offline  
Old 26/05/2010, 02:00 AM   #4
Saurik
High-roller
 
Saurik's Avatar
 
Join Date: Oct 2009
Location: Somewhere Far Reputation: 1,421
Posts: 1,228
Reputation: 274
Default Re: Make So Can't Move when Cuffed

TogglePlayerControllable(playerid, 0); is what makes the person not move....


when you uncuff someone you set it to TogglePlayerControllable(playerid, 1);
Saurik is offline  
Old 28/05/2010, 02:26 AM   #5
JustinB
Big Clucker
 
Join Date: Apr 2010
Posts: 71
Reputation: 1
Default Re: Make So Can't Move when Cuffed

thanks for help all its fixed
JustinB is offline  
 

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
How can you make a gate move? luey41 Help Archive 2 24/05/2010 08:06 PM
Make a door and make to move the gate whitedragon Help Archive 18 27/11/2009 09:39 PM
How do i make Gates move.. Studio Help Archive 5 07/08/2009 07:59 AM
Trying OnObjectMoved( to make one object move to different locations boelie Help Archive 7 30/06/2009 09:19 AM


All times are GMT. The time now is 07:38 AM.


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