Help me with freezing player while mapping loading
#1

Hello,I want code to put it in,my script to freeze,the player while the maping is loading to avoid bugs ,thanks
Reply
#2

pawn Код:
CMD:freeze(playerid, params[])
{
     if(IsPlayerAdmin(playerid))//is player rcon to freeze players
     {
          new pID;
          if(sscanf(params, "u", pID))return SendClientMessage(playerid, COLOR_WHITE, "Syntax: /freeze [PlayerID/Name]");
          TogglePlayerControlable(pID, 1);
     }
     return 1;
}
Just made the command havent time to make it "pro"
Reply
#3

How to make the command havn't time ? ,I am so sorry for asking alot,and when I put this code in pawn I put it for one time or before each mapping ?
Reply
#4

What you want to put is like a Timer Teleportation..Like when a player uses a cmd to get TPed somewhere he freezes auto-matically and then load the objects and unfreeze the player after everything has been loaded?
Reply
#5

Can I gave u the gamemode and u put it for me,cuz it make 4 error
Reply
#6

What GM is it?
Reply
#7

On the top of script :
PHP код:
forward PlayerControllableAfterSpawn(playerid); 
Everywhere you want :
PHP код:
stock SetPlayerPosEx(playeridFloat:XFloat:YFloat:Zinteriorid 0)
{
    
SetPlayerPos(playeridXYZ+0.5), SetPlayerInterior(playeridinteriorid);
    
TogglePlayerControllable(playeridfalse);
    
GameTextForPlayer(playerid "Please Wait..." 30005);
    
SetPlayerVirtualWorld(playerid 54);
    
SetTimerEx("PlayerControllableAfterSpawn"5000"i"playerid);
    return 
1;
}
public 
PlayerControllableAfterSpawn(playerid)
{
    
TogglePlayerControllable(playerid 1);
    
SetPlayerVirtualWorld(playerid 0);
    return 
1;

and then use SetPlayerPosEx for spawning
Reply
#8

Quote:
Originally Posted by amirab
Посмотреть сообщение
On the top of script :
PHP код:
forward PlayerControllableAfterSpawn(playerid); 
Everywhere you want :
PHP код:
stock SetPlayerPosEx(playeridFloat:XFloat:YFloat:Zinteriorid 0)
{
    
SetPlayerPos(playeridXYZ+0.5), SetPlayerInterior(playeridinteriorid);
    
TogglePlayerControllable(playeridfalse);
    
GameTextForPlayer(playerid "Please Wait..." 30005);
    
SetPlayerVirtualWorld(playerid 54);
    
SetTimerEx("PlayerControllableAfterSpawn"5000"i"playerid);
    return 
1;
}
public 
PlayerControllableAfterSpawn(playerid)
{
    
TogglePlayerControllable(playerid 1);
    
SetPlayerVirtualWorld(playerid 0);
    return 
1;

and then use SetPlayerPosEx for spawning
C:\Users\Hossam\Desktop\New Folder (2)\New Folder\Italy Mafia Vers6\gamemodes\IMV6.pwn(29129) : error 025: function heading differs from prototype
C:\Users\Hossam\Desktop\New Folder (2)\New Folder\Italy Mafia Vers6\gamemodes\IMV6.pwn(29130) : error 021: symbol already defined: "SetPlayerPosEx"
Reply
#9

On the top of script :
PHP код:
forward PlayerControllableAfterSpawn(playerid); 
Everywhere you want :
PHP код:
stock SetPlayerPosEx2(playeridFloat:XFloat:YFloat:Zinteriorid 0)
{
    
SetPlayerPos(playeridXYZ+0.5), SetPlayerInterior(playeridinteriorid);

    
TogglePlayerControllable(playeridfalse);
    
GameTextForPlayer(playerid "Please Wait..." 30005);
    
SetPlayerVirtualWorld(playerid 54);
    
SetTimerEx("PlayerControllableAfterSpawn"5000"i"playerid);
    return 
1;
}

public 
PlayerControllableAfterSpawn(playerid)
{
    
TogglePlayerControllable(playerid 1);
    
SetPlayerVirtualWorld(playerid 0);
    return 
1;

and then use SetPlayerPosEx2 for spawning
Reply
#10

It shows no error but it didn't freeze the player ,I want the player got,freeze for 4 second when he enter anywhere or tped or spawned or jailed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)