Problem with TogglePlayerControllable
#1

Hello,

I have a problem with function TogglePlayerControllable.

I have de follow code:
Код:
public SetPlayerSpawn(playerid)
{
.....
		    if(PlayerInfo[playerid][pTut] == 0)
		    {
				gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
				SafeSetPlayerInterior(playerid, 3);
				SafeSetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
				SetPlayerFacingAngle(playerid, 280);
				TogglePlayerControllable(playerid, 0);
				RegistrationStep[playerid] = 1;
				SendClientMessage(playerid, COLOR_LIGHTRED, "Hello there! Welcome to the Los Santo Immigration Center, I will be asking you a few questions.");
				SendClientMessage(playerid, COLOR_LIGHTRED, "First Question: Are you a Male or Female?");
				SendClientMessage(playerid, COLOR_LIGHTRED, "TIP: Please type in what you are! Don't worry, no one will see it!");
				PlayerInfo[playerid][pRegularCount] = 144000;
   				SafeGivePlayerMoney(playerid,500);
				return 1;
		    }
.....
}
But player not be freeze, he can moves.

Why toggle donґt work?

Regards
Reply
#2

pawn Код:
public SetPlayerSpawn(playerid)
{
.....
            if(PlayerInfo[playerid][pTut] == 0)
            {
                gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
                SafeSetPlayerInterior(playerid, 3);
                SafeSetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
                SetPlayerFacingAngle(playerid, 280);
                TogglePlayerControllable(playerid, 1); // Set that thing to 1 to freeze the player.
                RegistrationStep[playerid] = 1;
                SendClientMessage(playerid, COLOR_LIGHTRED, "Hello there! Welcome to the Los Santo Immigration Center, I will be asking you a few questions.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "First Question: Are you a Male or Female?");
                SendClientMessage(playerid, COLOR_LIGHTRED, "TIP: Please type in what you are! Don't worry, no one will see it!");
                PlayerInfo[playerid][pRegularCount] = 144000;
                SafeGivePlayerMoney(playerid,500);
                return 1;
            }
}
Reply
#3

hello,

but the wiki dont say that:

https://sampwiki.blast.hk/wroot/index.ph...le&redirect=no
Reply
#4

Quote:
Originally Posted by Cypress
Посмотреть сообщение
pawn Код:
public SetPlayerSpawn(playerid)
{
.....
            if(PlayerInfo[playerid][pTut] == 0)
            {
                gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
                SafeSetPlayerInterior(playerid, 3);
                SafeSetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
                SetPlayerFacingAngle(playerid, 280);
                TogglePlayerControllable(playerid, 1); // Set that thing to 1 to freeze the player.
                RegistrationStep[playerid] = 1;
                SendClientMessage(playerid, COLOR_LIGHTRED, "Hello there! Welcome to the Los Santo Immigration Center, I will be asking you a few questions.");
                SendClientMessage(playerid, COLOR_LIGHTRED, "First Question: Are you a Male or Female?");
                SendClientMessage(playerid, COLOR_LIGHTRED, "TIP: Please type in what you are! Don't worry, no one will see it!");
                PlayerInfo[playerid][pRegularCount] = 144000;
                SafeGivePlayerMoney(playerid,500);
                return 1;
            }
}
Your wrong. 0 to freeze the player or 1 to unfreeze them.

Edit: Too late
Reply
#5

yeah, but the player not freeze..

Why? anyone knows? this not work.

Regards
Reply
#6

Have a look at this thread.

https://sampforum.blast.hk/showthread.php?tid=184118

If you find it useful, pass some respect my way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)