08.04.2010, 23:47

How Do I make it so if I cage someone with this command it makes them unable to do commands?Heres Code:

public CagePrevent(playerid)

{

SetPlayerPos(playerid,LPosX[playerid],LPosY[playerid],LPosZ[playerid]);

TogglePlayerControllable(playerid, 0);

SendClientMessage(playerid,red,"|- You cant escape your punishment. You Are Still in Cage -|");

SetTimerEx("CagePlayer", 500, 0, "i", playerid);

SetTimerEx("UnCagePlayer", AccInfo[playerid][pCageTime]*1000, 0, "i", playerid);

return 1;

}

public CagePlayer(playerid)

{

if(IsPlayerConnected(playerid))

{

new Float:X, Float:Y, Float:Z;

GetPlayerPos(playerid, X, Y, Z);

cage[playerid] = CreateObject(985, X, Y+4, Z, 0.0, 0.0, 0.0);

cage2[playerid] = CreateObject(985, X+4, Y, Z, 0.0, 0.0, 90.0);

cage3[playerid] = CreateObject(985, X-4, Y, Z, 0.0, 0.0, 270.0);

cage4[playerid] = CreateObject(985, X, Y-4, Z, 0.0, 0.0, 180.0);

TogglePlayerControllable(playerid, 0);

PlayerPlaySound(playerid,1137,0.0,0.0,0.0);

GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~ n~~n~~r~Caged",3000, 3);

}

}

public CagePrevent(playerid)

{

SetPlayerPos(playerid,LPosX[playerid],LPosY[playerid],LPosZ[playerid]);

TogglePlayerControllable(playerid, 0);

SendClientMessage(playerid,red,"|- You cant escape your punishment. You Are Still in Cage -|");

SetTimerEx("CagePlayer", 500, 0, "i", playerid);

SetTimerEx("UnCagePlayer", AccInfo[playerid][pCageTime]*1000, 0, "i", playerid);

return 1;

}

public CagePlayer(playerid)

{

if(IsPlayerConnected(playerid))

{

new Float:X, Float:Y, Float:Z;

GetPlayerPos(playerid, X, Y, Z);

cage[playerid] = CreateObject(985, X, Y+4, Z, 0.0, 0.0, 0.0);

cage2[playerid] = CreateObject(985, X+4, Y, Z, 0.0, 0.0, 90.0);

cage3[playerid] = CreateObject(985, X-4, Y, Z, 0.0, 0.0, 270.0);

cage4[playerid] = CreateObject(985, X, Y-4, Z, 0.0, 0.0, 180.0);

TogglePlayerControllable(playerid, 0);

PlayerPlaySound(playerid,1137,0.0,0.0,0.0);

GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~ n~~n~~r~Caged",3000, 3);

}

}