SA-MP Forums Archive
Freeze player script - 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)
+--- Thread: Freeze player script (/showthread.php?tid=392128)



Freeze player script - Riggster - 12.11.2012

Just wondering if anyone could kindly help me by showing me what to put into my script when I want to freeze a player when they are cuffed

Here is my cuff and uncuff command so far:-
if (strcmp("/cuff", cmdtext, true, 7) == 0)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
PlayerPlaySound(playerid, 5201, x,y,z);
SendClientMessage(playerid, 0xFF0000AA, "* You are now cuffed.");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
return 1;
}
if (strcmp("/uncuff", cmdtext, true, 7) == 0)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
PlayerPlaySound(playerid, 5201, x,y,z);
SendClientMessage(playerid, 0x33AA33AA, "* You are now uncuffed.");
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
}
return 1;
}[/PHP][/PHP]


Re : Freeze player script - lelemaster - 13.11.2012

TogglePlayerControllable(The_ID, 0); // Freeze
TogglePlayerControllable(The_ID, 1); // UnFreeze

Just to tell you that now, the one that does /cuff will get handcuffs ( With what you showed me )


Respuesta: Freeze player script - stix - 13.11.2012

use zcmd

new targetid;
TogglePlayerControllable(targetid, 0);


Re: Freeze player script - blackbhuta - 13.11.2012

if (strcmp("/cuff", cmdtext, true, 7) == 0)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
PlayerPlaySound(playerid, 5201, x,y,z);
SendClientMessage(playerid, 0xFF0000AA, "* You are now cuffed.");
SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
TogglePlayerControllable(playerid, 0); // Freeze
return 1;
}
if (strcmp("/uncuff", cmdtext, true, 7) == 0)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
PlayerPlaySound(playerid, 5201, x,y,z);
SendClientMessage(playerid, 0x33AA33AA, "* You are now uncuffed.");
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
TogglePlayerControllable(playerid, 1); // UnFreeze
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
}
return 1;
}


Re: Freeze player script - Faisal_khan - 13.11.2012

Use pawn tags!!!