Solved Scripting Help [Warmod Pause] : How to freeze players ?

Vertigo

⍥????
Staff member
Administrator
Could you be more specific ?
What do you mean by not able to run the plugin ?
Is it not loading or loading but not working ?
If not working, then what is the expected behavior and what is actually happening ?

These things you should mention while asking the question.
 

XTreme killer

Active member
RIS Admin
Content Writer
Could you be more specific ?
What do you mean by not able to run the plugin ?
Is it not loading or loading but not working ?
If not working, then what is the expected behavior and what is actually happening ?

These things you should mention while asking the question.
Expected behaviour:
Movement of every player should be stopped and color of them should be changed to blue.
And after 30 sec, they will automatically get unfreezed
 

Vertigo

⍥????
Staff member
Administrator
Change
C++:
RegAdminCmd("pause", Pause_game, ADMFLAG_CUSTOM1);
RegAdminCmd("unpause", UnPause_game, ADMFLAG_CUSTOM1);
To
C++:
RegAdminCmd("sm_pause", Pause_game, ADMFLAG_CUSTOM1);
RegAdminCmd("sm_unpause", UnPause_game, ADMFLAG_CUSTOM1);
 

XTreme killer

Active member
RIS Admin
Content Writer
Change
C++:
RegAdminCmd("pause", Pause_game, ADMFLAG_CUSTOM1);
RegAdminCmd("unpause", UnPause_game, ADMFLAG_CUSTOM1);
To
C++:
RegAdminCmd("sm_pause", Pause_game, ADMFLAG_CUSTOM1);
RegAdminCmd("sm_unpause", UnPause_game, ADMFLAG_CUSTOM1);
But fs plugin also has no prefix
 

Vertigo

⍥????
Staff member
Administrator
But fs plugin also has no prefix
The problem is not the prefix. The problem are the words "pause" and "unpause". They are kind of reserved words. You can't use them without sm_ prefix or hooking chat.

Expected behaviour:
Movement of every player should be stopped and color of them should be changed to blue.
And after 30 sec, they will automatically get unfreezed
Pause command worked but why am I not able to stop all player's movement by this???
You are doing wrong while freezing the players.
Instead of this code,
C++:
for(int i = 1; i <= MaxClients; i++)
{
    new AllClient = GetClientSerial(i);
    FreezePlayer(AllClient);
}
Simply use,
C++:
for(int i = 1; i <= MaxClients; i++)
{
    if(IsClientInGame(i) && !IsFakeClient(i))
    {
         int userid = GetClientUserId(i);
         ServerCommand("sm_freeze #%d 30", userid);
    }
}
You do not need to implement the freezing functionality again.
 

XTreme killer

Active member
RIS Admin
Content Writer
The problem is not the prefix. The problem are the words "pause" and "unpause". They are kind of reserved words. You can't use them without sm_ prefix or hooking chat.



You are doing wrong while freezing the players.
Instead of this code,
C++:
for(int i = 1; i <= MaxClients; i++)
{
    new AllClient = GetClientSerial(i);
    FreezePlayer(AllClient);
}
Simply use,
C++:
for(int i = 1; i <= MaxClients; i++)
{
    if(IsClientInGame(i) && !IsFakeClient(i))
    {
         int userid = GetClientUserId(i);
         ServerCommand("sm_freeze #%d 30", userid);
    }
}
You do not need to implement the freezing functionality again.
Ok Thanks so much.
 

XTreme killer

Active member
RIS Admin
Content Writer
It's not done yet. You can check with @XTreme killer
switch(error)
{
case( using on terminate round & ending round with draw)
{
Even on drawing round == counts a score of any one team by warmod plugin.
}
case (using on terminate round & ending round with ct win)
{
Even if i SetConvarInt ("wm_ct_score") to old score , but it is not reflected in game
}
}

@Vertigo Help me in error
 

Vertigo

⍥????
Staff member
Administrator
What is error ?
 

Vertigo

⍥????
Staff member
Administrator
The manual setting of CT score won't reflect in game, because wm_max_rounds is set to "15". And the current round counter inside warmod plugin keeps track of the rounds played.

So you need to avoid round end.

Better do this -->

Assuming you want to pause for 30 seconds

1. Use global boolean variable isPausable=false.
2. Hook round start event in OnPluginStart.
3. Any team calls !pause.
4. On command action make isPausable=true and set the convar mp_roundtime value to (current round time +30) and set the convar mp_freezetime value to 30.
5. In round start event, if(isPausable) then set the mp_roundtime and mp_freezetime values back to original.And set isPausable to false.
 

XTreme killer

Active member
RIS Admin
Content Writer
The manual setting of CT score won't reflect in game, because wm_max_rounds is set to "15". And the current round counter inside warmod plugin keeps track of the rounds played.

So you need to avoid round end.

Better do this -->

Assuming you want to pause for 30 seconds

1. Use global boolean variable isPausable=false.
2. Hook round start event in OnPluginStart.
3. Any team calls !pause.
4. On command action make isPausable=true and set the convar mp_roundtime value to (current round time +30) and set the convar mp_freezetime value to 30.
5. In round start event, if(isPausable) then set the mp_roundtime and mp_freezetime values back to original.And set isPausable to false.
It makes round pause for next round not for current round.

I wan to make round pause for current one.
 
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock