Make So Can't Move when Cuffed
#1

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;
	}
Reply
#2

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)
Reply
#3

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.
Reply
#4

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


when you uncuff someone you set it to TogglePlayerControllable(playerid, 1);
Reply
#5

thanks for help all its fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)