Freeze timer
#1

I wanted to ask how can i add a freeze timer to this:
PHP код:
if(strcmp(cmdtext"/enter"true) == 0)
    {
    if(
IsPlayerConnected(playerid))
       {
   if 
PlayerToPoint(5,playerid,-2080.7998356.992436.7698)
         *
then
         
{
           
SetPlayerPos(playerid,-1443.8389,-204.0373,1072.5171);
           
SetPlayerInterior(playerid,7);
           
PlayAudioStreamForPlayer(playerid"http://www.greudedifuzat.eu/greudedifuzat.m3u",-1479.73, -205.131081.50,5001);
           
SendClientMessage(playerid,COLOR_GREEN,"*** Welcome to San Fierro Cinema!");
           return 
1;
         }
        }
    } 
Reply
#2

For one you don't need to check this if(IsPlayerConnected(playerid)) secondly what the hell is a "freeze timer" ? Explain in more depth.
Reply
#3

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
For one you don't need to check this if(IsPlayerConnected(playerid)) secondly what the hell is a "freeze timer" ? Explain in more depth.
Like when player goes to an costum interior, it needs a bit time to load, so player has to be frozen in the target checkpoint otherways player falls from the air.
Reply
#4

Код:
forward intfreeze(playerid);
if(strcmp(cmdtext, "/enter", true) == 0) 
    { 
    if(IsPlayerConnected(playerid)) 
       { 
   if PlayerToPoint(5,playerid,-2080.7998, 356.9924, 36.7698) 
         *then 
         { 
           SetPlayerPos(playerid,-1443.8389,-204.0373,1072.5171); 
           SetPlayerInterior(playerid,7); 
           PlayAudioStreamForPlayer(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u",-1479.73, -205.13, 1081.50,500, 1); 
           SendClientMessage(playerid,COLOR_GREEN,"*** Welcome to San Fierro Cinema!");
           TogglePlayerControllable(playerid, false);
           SetTimerEx("intfreeze", 2000, false, "i", playerid);//Freeze the player for 2 seconds, for higher values replace "2000" with the wanted time in milliseconds
           return 1; 
         } 
        } 
    }
public intfreeze(playerid)
{
  return TogglePlayerControllable(playerid, true);
}
Reply
#5

Quote:
Originally Posted by Koala818
Посмотреть сообщение
Код:
forward intfreeze(playerid);
if(strcmp(cmdtext, "/enter", true) == 0) 
    { 
    if(IsPlayerConnected(playerid)) 
       { 
   if PlayerToPoint(5,playerid,-2080.7998, 356.9924, 36.7698) 
         *then 
         { 
           SetPlayerPos(playerid,-1443.8389,-204.0373,1072.5171); 
           SetPlayerInterior(playerid,7); 
           PlayAudioStreamForPlayer(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u",-1479.73, -205.13, 1081.50,500, 1); 
           SendClientMessage(playerid,COLOR_GREEN,"*** Welcome to San Fierro Cinema!");
           TogglePlayerControllable(playerid, false);
           SetTimerEx("intfreeze", 2000, false, "i", playerid);//Freeze the player for 2 seconds, for higher values replace "2000" with the wanted time in milliseconds
           return 1; 
         } 
        } 
    }
public intfreeze(playerid)
{
  return TogglePlayerControllable(playerid, true);
}
Thanks dude Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)