15.06.2010, 08:39
Hey. I'm trying to make it so when you type /enter you get frozen for some seconds and then get auto-unfreezed, but it only seems to be working for ID 0. It works fine for me (id 0), but my friends stay frozen.
This is how my code looks like:
This is how my code looks like:
pawn Код:
forward freezeonenter();
new freezeonenterr;
if(strcmp(cmd, "/enter", true) == 0)
{
for(new i = 0; i < sizeof(Houses); i++)
{
if(PlayerToPoint(1.0,playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Houses[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouseKey] == i || Houses[i][Locked] == 0 || PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid, 0xAAAAAAAA, "You have been frozed, loading interior objects.");
TogglePlayerControllable(playerid, 0);
SetTimer("freezeonenter",3000,0);
SetPlayerInterior(playerid,Houses[i][ExitInterior]);
SetPlayerPos(playerid,Houses[i][ExitX],Houses[i][ExitY],Houses[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Houses[i][ExitAngle]);
}
else
{
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
}
}
}
}
public freezeonenter()
{
TogglePlayerControllable(freezeonenterr, 1);
return 1;
}