Auto Pause :)
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
Auto Pause :)
hi,
i have make a plugin there auto paused a game when a player go paused
Player XXX go pause! Game Paused! <-- player XXX go pause
Player XXX is Resume! Game Resume! <-- player XXX resume
Player XXX is Resume! ( When more then 1 player paused ) <-- player XXX resume
__________________________________
in pause mode:
when player XXX shot player YYY:
say "Player XXX do kill a Player! DO not kill!!!!!!"
kill player XXX
when player XXX kicked or ban and he is paused --> countdown resume
set _shotSpeed to 0
set _jumpVelocity to 0
set _tankAngVel to 0.000001
set _tankSpeed to 0.000001
in "resume" mode
set _shotSpeed to 100
set _jumpVelocity to 19
set _tankSpeed to 25
set _tankAngVel to 0.785398
set _tankSpeed to 25
comands:
/pause <-- make the game pause and stop all tanks
/resume <-- make the game resume alowe to swam
i have make a plugin there auto paused a game when a player go paused
Player XXX go pause! Game Paused! <-- player XXX go pause
Player XXX is Resume! Game Resume! <-- player XXX resume
Player XXX is Resume! ( When more then 1 player paused ) <-- player XXX resume
__________________________________
in pause mode:
when player XXX shot player YYY:
say "Player XXX do kill a Player! DO not kill!!!!!!"
kill player XXX
when player XXX kicked or ban and he is paused --> countdown resume
set _shotSpeed to 0
set _jumpVelocity to 0
set _tankAngVel to 0.000001
set _tankSpeed to 0.000001
in "resume" mode
set _shotSpeed to 100
set _jumpVelocity to 19
set _tankSpeed to 25
set _tankAngVel to 0.785398
set _tankSpeed to 25
comands:
/pause <-- make the game pause and stop all tanks
/resume <-- make the game resume alowe to swam
- Attachments
-
- 1.0.5 Source.zip
- Source V1.0.5
- (731.93 KiB) Downloaded 300 times
-
- Playerpausemakegamepause.zip
- V 1.0.5
- (8.15 KiB) Downloaded 323 times
Last edited by Links 2004 on Sat May 27, 2006 9:19 pm, edited 4 times in total.
So...
This plugin will automatically stop play and stop the countdown when a player pauses? If so, good job.
I dont know if this is possible but:
A plugin that will;
1). If a player says 'stop' the countdown pauses, and everyone stops movi ng.
2). Same as what this plugin does (when a player presses pause)
This plugin will automatically stop play and stop the countdown when a player pauses? If so, good job.
I dont know if this is possible but:
A plugin that will;
1). If a player says 'stop' the countdown pauses, and everyone stops movi ng.
2). Same as what this plugin does (when a player presses pause)
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
- The Red Baron
- Sergeant First Class
- Posts: 987
- Joined: Sat Dec 07, 2002 6:21 am
- Contact:
- A Meteorite
- Private First Class
- Posts: 1786
- Joined: Thu Apr 28, 2005 12:56 am
- Location: California, U.S.
- Contact:
JeffM2501
Well, maybe that would be a nice protocol change for 2.1 then?
I would find it quite useful for matches - especially if it stopped all shots (since getting hit from a shot while being forcefully paused is just not fair ).
Well, maybe that would be a nice protocol change for 2.1 then?
I would find it quite useful for matches - especially if it stopped all shots (since getting hit from a shot while being forcefully paused is just not fair ).
Owner @ BZFX
Core Admin @ CAN
Email me: bzmet…@gmail.com
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
- CannonBallGuy
- Private First Class
- Posts: 2083
- Joined: Wed Apr 12, 2006 1:31 am
- Contact:
Links 2004
Should be a very useful plugin!
Can you also make the server say:
"Stop player_name has paused! Please stay still!"
when someone pauses and the countdown is paused..?
Should be a very useful plugin!
Can you also make the server say:
"Stop player_name has paused! Please stay still!"
when someone pauses and the countdown is paused..?
Merry Christmas!
"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."
"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
my plugin say to all :
Player XXX go pause! Game Paused!
Player XXX is Resume! Game Resume!
Player XXX is Resume! ( When more then 1 player paused )
Edit:
my plugin say:
Player XXX go pause! Game Paused! <-- player XXX go pause
Player XXX is Resume! Game Resume! <-- player XXX resume
Player XXX is Resume! ( When more then 1 player paused ) <-- player XXX resume
Player Paused!! Do not Play !!! <-- >1 player paused and player XXX shot
Player XXX do kill a Player! DO not kill!!!!!! <-- >1 player paused and player XXX kill player YYY
Edit 2:
Know anyone the setfunction for vriable in a plugin?
Player XXX go pause! Game Paused!
Player XXX is Resume! Game Resume!
Player XXX is Resume! ( When more then 1 player paused )
Edit:
my plugin say:
Player XXX go pause! Game Paused! <-- player XXX go pause
Player XXX is Resume! Game Resume! <-- player XXX resume
Player XXX is Resume! ( When more then 1 player paused ) <-- player XXX resume
Player Paused!! Do not Play !!! <-- >1 player paused and player XXX shot
Player XXX do kill a Player! DO not kill!!!!!! <-- >1 player paused and player XXX kill player YYY
Edit 2:
Know anyone the setfunction for vriable in a plugin?
- Attachments
-
- Playerpausemakegamepause.zip
- V 1.0.1
- (157.34 KiB) Downloaded 286 times
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
yes i make it .
but i need the API function to set the tanxSpeed the shotSpeet i have found but no function for tanx.
i need a set for float
i have found in the api:
BZF_API bool bz_setBZDBDouble ( const char* variable, double val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBString( const char* variable, const char *val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBBool( const char* variable, bool val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBInt( const char* variable, int val, int perms = 0, bool persistent = false );
but no for set a float
but i need the API function to set the tanxSpeed the shotSpeet i have found but no function for tanx.
i need a set for float
i have found in the api:
BZF_API bool bz_setBZDBDouble ( const char* variable, double val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBString( const char* variable, const char *val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBBool( const char* variable, bool val, int perms = 0, bool persistent = false );
BZF_API bool bz_setBZDBInt( const char* variable, int val, int perms = 0, bool persistent = false );
but no for set a float
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
hi all
new in 1.0.3:
in pause mode:
when player XXX shot player YYY --> player XXX DIE
when player XXX kicked or ban and he is paused --> countdown resume
set _shotSpeed to 0
set _jumpVelocity to 0
set _tankSpeed to 0 <-- do not work ???
in "resume" mode
set _shotSpeed to 100
set _jumpVelocity to 19
set _tankSpeed to 25 <-- do not work ???
I need assistance: White someone like one the tank speed seten can I get it not work!
new in 1.0.3:
in pause mode:
when player XXX shot player YYY --> player XXX DIE
when player XXX kicked or ban and he is paused --> countdown resume
set _shotSpeed to 0
set _jumpVelocity to 0
set _tankSpeed to 0 <-- do not work ???
in "resume" mode
set _shotSpeed to 100
set _jumpVelocity to 19
set _tankSpeed to 25 <-- do not work ???
I need assistance: White someone like one the tank speed seten can I get it not work!
- Attachments
-
- Playerpausemakegamepause.zip
- V1.0.3
- (6.88 KiB) Downloaded 291 times
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
here is my code to set the tanx speed:
edit:
i find no "CustomSlashCommand" in the play history tracker
Code: Select all
// Playerpausemakegamepause.cpp : Defines the entry point for the DLL application.
//
#include "bzfsAPI.h"
#include <string>
BZ_GET_PLUGIN_VERSION
// event handler callback
class start : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class playerPause : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class stop : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class schuss : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class die : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class kick : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class ban : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class join : public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
//bz_CustomSlashCommandHandler
/*
class makepause : public bz_CustomSlashCommandHandler, public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
class makeresume : public bz_CustomSlashCommandHandler, public bz_EventHandler
{
public:
virtual void process ( bz_EventData *eventData );
};
*/
////////////////////////////////////
int isstartg = 0;
int Userpause[999];
int pausecount = 0;
start start;
stop stop;
playerPause playerPause;
schuss schuss;
die die;
kick kick;
ban ban;
join join;
/*makepause makepause;
makeresume makeresume;*/
BZF_PLUGIN_CALL int bz_Load ( const char* commandLine )
{
bz_debugMessage(4,"Auto Paused plugin loaded");
/*
bz_registerCustomSlashCommand("pause",&makepause);
bz_registerCustomSlashCommand("resume",&makeresume);
*/
bz_registerEvent(bz_ePlayerJoinEvent,&join);
bz_registerEvent(bz_eGameStartEvent,&start);
bz_registerEvent(bz_ePlayerPausedEvent,&playerPause);
bz_registerEvent(bz_eGameEndEvent,&stop);
bz_registerEvent(bz_eShotFiredEvent,&schuss);
bz_registerEvent(bz_ePlayerDieEvent,&die);
bz_registerEvent(bz_eKickEvent,&kick);
bz_registerEvent(bz_eBanEvent,&ban);
std::string param = commandLine;
if (param == "usevictim")
bz_debugMessage(0,"Auto Paused plugin no longer takes any paramaters");
return 0;
}
BZF_PLUGIN_CALL int bz_Unload ( void )
{
/*
bz_removeCustomSlashCommand("pause",&makepause);
bz_removeCustomSlashCommand("resume",&makeresume);
*/
bz_removeEvent(bz_ePlayerJoinEvent,&join);
bz_removeEvent(bz_eGameStartEvent,&start);
bz_removeEvent(bz_ePlayerPausedEvent,&playerPause);
bz_removeEvent(bz_eGameEndEvent,&stop);
bz_removeEvent(bz_ePlayerDieEvent,&die);
bz_removeEvent(bz_eShotFiredEvent,&schuss);
bz_removeEvent(bz_eKickEvent,&kick);
bz_removeEvent(bz_eBanEvent,&ban);
bz_debugMessage(4,"Auto Paused plugin unloaded");
return 0;
}
///////////////////////////////////////////////////////
/*
void makepause::process( bz_EventData *eventData){
if(isstartg != 0){
bz_pauseCountdown("Server");
pausecount=pausecount+1;
bz_setBZDBDouble("_tankSpeed",0.0);
bz_setBZDBDouble("_shotSpeed",0.0);
bz_setBZDBDouble("_jumpVelocity",0.0);
} else {
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,"No Game runing!");
}
}
void makeresume::process( bz_EventData *eventData){
if(isstartg != 0){
bz_resumeCountdown("Server");
pausecount=0;
bz_setBZDBDouble("_tankSpeed",25.0);
bz_setBZDBDouble("_shotSpeed",100.0);
bz_setBZDBDouble("_jumpVelocity",19.0);
} else {
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,"No Game runing!");
}
}
*/
///////////////////////////////////////////////////
//JOIN
void join::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_ePlayerJoinEvent)
return;
bz_PlayerJoinPartEventData *joinData = (bz_PlayerJoinPartEventData*)eventData;
bz_sendTextMessage(BZ_SERVER,joinData->playerID,"Auto Paused Plugin is loaded.");
bz_sendTextMessage(BZ_SERVER,joinData->playerID,"Use /countdown <sec> to start a game.");
bz_sendTextMessage(BZ_SERVER,joinData->playerID,"Use /pause to Paused a game.");
bz_sendTextMessage(BZ_SERVER,joinData->playerID,"Use /resume to Resume a game.");
bz_sendTextMessage(BZ_SERVER,joinData->playerID," Auto Pause is make by Links ");
Userpause[joinData->playerID] = 0;
}
///////////////////////////////////////////////////
//BAN
void ban::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_eBanEvent)
return;
bz_BanEventData *BanData = (bz_BanEventData*)eventData;
if(Userpause[BanData->banneeID] == 1){
Userpause[BanData->banneeID] = 0;
pausecount=pausecount-1;
}
///////////
std::string killerCallSign = "UNKNOWN";
bz_PlayerRecord *killerData;
killerData = bz_getPlayerByIndex(BanData->banneeID);
if (killerData)
killerCallSign = killerData->callsign.c_str();
std::string message;
message = std::string("Player ")+ killerCallSign + std::string(" Baned!");
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
///////////
if(pausecount == 0){
/////////////////////////////////
bz_setBZDBDouble("_tankSpeed",25.0);
bz_setBZDBDouble("_shotSpeed",100.0);
bz_setBZDBDouble("_jumpVelocity",19.0);
/////////////////////////////////
bz_resumeCountdown("Server");
}
}
///////////////////////////////////////////////////
//Kick
void kick::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_eKickEvent)
return;
bz_KickEventData *kickData = (bz_KickEventData*)eventData;
if(Userpause[kickData->kickedID] == 1){
Userpause[kickData->kickedID] = 0;
pausecount=pausecount-1;
}
///////////
std::string killerCallSign = "UNKNOWN";
bz_PlayerRecord *killerData;
killerData = bz_getPlayerByIndex(kickData->kickedID);
if (killerData)
killerCallSign = killerData->callsign.c_str();
std::string message;
message = std::string("Player ")+ killerCallSign + std::string(" Kicked!");
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
///////////
if(pausecount == 0){
/////////////////////////////////
bz_setBZDBDouble("_tankSpeed",25.0);
bz_setBZDBDouble("_shotSpeed",100.0);
bz_setBZDBDouble("_jumpVelocity",19.0);
/////////////////////////////////
bz_resumeCountdown("Server");
}
}
///////////////////////////////////////////////////
//DIE
void die::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_ePlayerDieEvent)
return;
bz_PlayerDieEventData *dieData = (bz_PlayerDieEventData*)eventData;
if(pausecount != 0){
int playerToUse = BZ_SERVER;
///////////////////////////////////
std::string killerCallSign = "UNKNOWN";
bz_PlayerRecord *killerData;
killerData = bz_getPlayerByIndex(dieData->killerID);
if (killerData)
killerCallSign = killerData->callsign.c_str();
std::string message;
message = std::string("Player ")+ killerCallSign + std::string(" do kill a Player! DO not kill!!!!!!");
bz_killPlayer(dieData->killerID,true,dieData->playerID);
bz_sendPlayCustomLocalSound ( dieData->killerID, "killteam" );
//bz_sendTextMessage(playerToUse, joinData->playerID,message.c_str());
//bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,"Player Paused!! Do not Play !!!");
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
///////////////////////////////
}
}
///////////////////////////////////////////////////
//shot
void schuss::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_eShotFiredEvent)
return;
bz_ShotFiredEventData *FiredData = (bz_ShotFiredEventData*)eventData;
if(pausecount != 0){
int playerToUse = BZ_SERVER;
// Kill the player when he shote!
/*
float reloadTime = (float)bz_getBZDBDouble("_reloadTime");
if (bz_BZDBItemExists("_swDeathReloadFactor") && bz_getBZDBDouble("_swDeathReloadFactor") > 0)
reloadTime *= (float)bz_getBZDBDouble("_swDeathReloadFactor");
bz_fireWorldWep("SW",reloadTime,playerToUse,FiredData->pos,0,0,0,0.0f);
*/
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,"Player Paused!! Do not Play !!!");
}
}
///////////////////////////////////////////////////
//End Game
void stop::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_eGameEndEvent)
return;
bz_resetTeamScores();
bz_resetFlags(true);
isstartg = 0;
}
///////////////////////////////////////////////////
//Start Game
void start::process( bz_EventData *eventData ){
std::string soundToPlay;
if (eventData->eventType != bz_eGameStartEvent)
return;
//bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, " ");
//bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, "Have fun! Do not Cheat!");
//bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, "Good Luck!");
bz_resetTeamScores();
bz_resetFlags(true);
isstartg = 1;
}
///////////////////////////////////////////////////
//player go pause
void playerPause::process(bz_EventData *eventData)
{
std::string soundToPlay;
if (eventData->eventType != bz_ePlayerPausedEvent)
return;
bz_GameStartEndEventData *gameData = (bz_GameStartEndEventData*)eventData;
bz_PlayerPausedEventData *pauseData = (bz_PlayerPausedEventData*)eventData;
if(isstartg == 1){
std::string killerCallSign = "UNKNOWN";
bz_PlayerRecord *killerData;
killerData = bz_getPlayerByIndex(pauseData->player);
if (killerData)
killerCallSign = killerData->callsign.c_str();
std::string message;
if(Userpause[pauseData->player] == 0){ Userpause[pauseData->player] = 1;
message = std::string("Player ")+ killerCallSign + std::string(" go pause! Game Paused!");
//bz_sendTextMessage(playerToUse, joinData->playerID,message.c_str());
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
/////////////////////////////////
bz_setBZDBDouble("_tankSpeed",0.0);
bz_setBZDBDouble("_shotSpeed",0.0);
bz_setBZDBDouble("_jumpVelocity",0.0);
/////////////////////////////////
bz_pauseCountdown("Server");
pausecount=pausecount+1;
} else {
pausecount=pausecount-1;
if(pausecount == 0){
message = std::string("Player ")+ killerCallSign + std::string(" is Resume! Game Resume!");
//bz_sendTextMessage(playerToUse, joinData->playerID,message.c_str());
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
/////////////////////////////////
bz_setBZDBDouble("_tankSpeed",25.0);
bz_setBZDBDouble("_shotSpeed",100.0);
bz_setBZDBDouble("_jumpVelocity",19.0);
/////////////////////////////////
bz_resumeCountdown("Server");
Userpause[pauseData->player] = 0;
} else {
message = std::string("Player ")+ killerCallSign + std::string(" is Resume! ");
//bz_sendTextMessage(playerToUse, joinData->playerID,message.c_str());
bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS,message.c_str());
Userpause[pauseData->player] = 0;
}
}
}
}
// Local Variables: ***
// mode:C++ ***
// tab-width: 8 ***
// c-basic-offset: 2 ***
// indent-tabs-mode: t ***
// End: ***
// ex: shiftwidth=2 tabstop=8
edit:
i find no "CustomSlashCommand" in the play history tracker
your code is rather complex and I'm not sure how it works. so I just made a simple sample. I don't want to go and debug your entire plugin for you.
the function works fine ( set the speed to 100 ).
perhaps your code isn't doing what you think it's doing.
the function works fine ( set the speed to 100 ).
perhaps your code isn't doing what you think it's doing.
- Attachments
-
- SAMPLE_PLUGIN.cpp
- (583 Bytes) Downloaded 302 times
JeffM
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
- Links 2004
- Private First Class
- Posts: 85
- Joined: Sat Jan 01, 2005 6:54 pm
- Location: Ger
- Contact:
new in V 1.0.5:
pausemode:
set _tankAngVel to 0.000001
set _tankSpeed to 0.000001
resumemode:
set _tankAngVel to 0.785398
set _tankSpeed to 25
comands:
/pause <-- make the game pause and stop all tanks
/resume <-- make the game resume alowe to swam
pausemode:
set _tankAngVel to 0.000001
set _tankSpeed to 0.000001
resumemode:
set _tankAngVel to 0.785398
set _tankSpeed to 25
comands:
/pause <-- make the game pause and stop all tanks
/resume <-- make the game resume alowe to swam
- Attachments
-
- Playerpausemakegamepause.zip
- V 1.0.5
- (8.15 KiB) Downloaded 295 times