Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: Pawno on January 28, 2011, 12:43:41 PM

Title: Help /c freeze all
Post by: Pawno on January 28, 2011, 12:43:41 PM
I need the code /c freeze all in GUPS

/c unfreezeall

   else if (strcmp(cmd, "freezeall", true) == 0) {
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else {
         FreezeAll();
      }
      return 1;
   }
Add this some where on the bottom of your script
Code:
stock FreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,1);
    }
}

@Edit --

Thanks to everyone who helped me
Title: Re: Help /c freeze all
Post by: Robd on January 28, 2011, 09:54:43 PM
in gups you will find a command called "healall" I use that as a base
search for HealAll, untilyou find
Public HealAll
copy that whole command and paste it below
rename Public HealAll to "Public FreezeAll"

find where it says "setplayerhealth"
highligt that and type this instead "TogglePlayerControllable(i,0);

find the command freeze
replace "TogglePlayerControlable(plr, 0)" with "PublicFreezeAll"
after that your command should work.
Dont forget to make a similar command for unfreeze  ;)
Title: Re: Help /c freeze all
Post by: Aldo on January 28, 2011, 10:13:49 PM
Add this under the /c healall command

else if (strcmp(cmd, "freezeall", true) == 0) {
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else {
FreezeAll();
}
return 1;
}



Add this some where on the bottom of your script

stock FreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,0);
    }
}
Title: Re: Help /c freeze all
Post by: Robd on January 28, 2011, 10:53:42 PM
Quote from: Aldo on January 28, 2011, 10:13:49 PM
Add this under the /c healall command

else if (strcmp(cmd, "freezeall", true) == 0) {
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else {
FreezeAll();
}
return 1;
}



Add this some where on the bottom of your script

stock FreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,0);
    }
}

Omg idea steal!!
lol jk, we're freinds... for now
Title: Re: Help /c freeze all
Post by: Aldo on January 28, 2011, 11:41:38 PM
Quote from: Robd on January 28, 2011, 10:53:42 PM
Quote from: Aldo on January 28, 2011, 10:13:49 PM
Add this under the /c healall command

else if (strcmp(cmd, "freezeall", true) == 0) {
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else {
FreezeAll();
}
return 1;
}



Add this some where on the bottom of your script

stock FreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,0);
    }
}

Omg idea steal!!
lol jk, we're freinds... for now

I wrote it out so he would understand  ;D
Title: Re: Help /c freeze all
Post by: [VU_T]Donstald on February 08, 2011, 12:46:31 AM
Thanks aldo for writing out the codes and it been really helpful
but how do i unfreeze

can you post codes for unfreezeall?
Title: Re: Help /c freeze all
Post by: BIG[H] on February 08, 2011, 11:07:12 PM
Quoteelse if (strcmp(cmd, "unfreezeall", true) == 0) {
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else {
         unFreezeAll();
      }
      return 1;
   }

Quotestock unFreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,1);
    }
}

:p piece of Cake
Title: Re: Help /c freeze all
Post by: yazeen on March 15, 2011, 10:09:03 AM
Quote from: BIG[H] on February 08, 2011, 11:07:12 PM
Quoteelse if (strcmp(cmd, "unfreezeall", true) == 0) {
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else {
         unFreezeAll();
      }
      return 1;
   }




Quotestock unFreezeAll()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) == 1) TogglePlayerControllable(i,1);
    }
}

:p piece of Cake

Simple is

SetPlayerControll(0,0);
SetPlayerControll(1,0);
SetPlayerControll(2,0);
SetPlayerControll(3,0);
SetPlayerControll(4,0);
SetPlayerControll(5,0);
SetPlayerControll(6,0);
SetPlayerControll(7,0);
SetPlayerControll(8,0);
SetPlayerControll(9,0);
SetPlayerControll(10,0);
SetPlayerControll(11,0);
SetPlayerControll(12,0);
Etc

Simple and best way
Title: Re: Help /c freeze all
Post by: Robd on March 31, 2011, 12:18:50 AM
That isn't the best for 2 reasons.

#1 if there are more players then you just got pwned
#2 the more functions you use the slower your serverr goes (that wouldnt affect it much, but still)
Title: Re: Help /c freeze all
Post by: tato on March 31, 2011, 03:41:30 AM
Quote from: Robd on March 31, 2011, 12:18:50 AM
That isn't the best for 2 reasons.

#1 if there are more players then you just got pwned
#2 the more functions you use the slower your serverr goes (that wouldnt affect it much, but still)
but what are u talking about
Title: Re: Help /c freeze all
Post by: Madara on March 31, 2011, 09:49:34 AM
Quote from: tato on March 31, 2011, 03:41:30 AM
Quote from: Robd on March 31, 2011, 12:18:50 AM
That isn't the best for 2 reasons.

#1 if there are more players then you just got pwned
#2 the more functions you use the slower your serverr goes (that wouldnt affect it much, but still)
but what are u talking about
Title: Re: Help /c freeze all
Post by: Robd on April 06, 2011, 05:51:10 AM
I am talking about cookies.

**
basically what i said was if u do what he did then it only works for so many players, and, it makes ur server go slower then the other way