Make So Can't Move when Cuffed - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Make So Can't Move when Cuffed (
/showthread.php?tid=150361)
Make So Can't Move when Cuffed -
JustinB - 25.05.2010
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;
}
Re: Make So Can't Move when Cuffed -
Anthony_Brassi - 25.05.2010
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)
Re: Make So Can't Move when Cuffed -
Lilcuete - 26.05.2010
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.
Re: Make So Can't Move when Cuffed -
Saurik - 26.05.2010
TogglePlayerControllable(playerid, 0); is what makes the person not move....
when you uncuff someone you set it to TogglePlayerControllable(playerid, 1);
Re: Make So Can't Move when Cuffed -
JustinB - 28.05.2010
thanks for help all its fixed