15.01.2013, 19:09
Anti-Camp Include
By BlackBank3
Little description:
With this script you can detect players that are camping.
You can choose whatever you want to do with them, because i've implanted a callback that will be called if the player is camping.
You can also change the react time of the anti-camp system and the distance check.
Functions:
Callbacks:
Notes:
- You can change the distance with ANTI_CAMP_DISTANCE define. Default it's set on 6.0.
- React time means the time when he will call the Callback and detects you as a 'camper'.
- The default react time in seconds is "AC_DEFAULT_REACT_TIME =" 7 seconds.
- You can only include this script in ONE script. Next version will support more then only one script.
Little Example:
Thanks to:
Michael@Belgium (For the idea).
Download:
.zip: http://blackbanks.net/samp/anti-camp.zip
Pastebin: http://pastebin.com/xxrQuRBL
By BlackBank3
Little description:
With this script you can detect players that are camping.
You can choose whatever you want to do with them, because i've implanted a callback that will be called if the player is camping.
You can also change the react time of the anti-camp system and the distance check.
Functions:
Код:
AntiCamp_Enable(playerid, ReactTimeInSeconds = AC_DEFAULT_REACT_TIME, bool:enabled = true); AntiCamp_Disable(playerid); AntiCamp_ResetReactCount(playerid); AntiCamp_SetReactTime(playerid, Seconds = AC_DEFAULT_REACT_TIME); AntiCamp_IsEnabled(playerid);
Код:
public OnPlayerCamping(playerid)
- You can change the distance with ANTI_CAMP_DISTANCE define. Default it's set on 6.0.
- React time means the time when he will call the Callback and detects you as a 'camper'.
- The default react time in seconds is "AC_DEFAULT_REACT_TIME =" 7 seconds.
- You can only include this script in ONE script. Next version will support more then only one script.
Little Example:
pawn Код:
#include <anti-camp>
public OnPlayerCamping(playerid)
{
SendClientMessage(playerid, -1, "ANTI-CAMP: Camping is not allowed on this server!");
SetPlayerHealth(playerid, 0.0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/anticamp") == 0)
{
if(AntiCamp_IsEnabled(playerid) == 0)
{
AntiCamp_Enable(playerid, 10); //Enable anti-camp, with a react time of 10 seconds.
SendClientMessage(playerid, -1, "ANTI-CAMP is now on!");
}
else
{
AntiCamp_Disable(playerid); //Disable anti-camp.
SendClientMessage(playerid, -1, "ANTI-CAMP is now off!");
}
return 1;
}
return 0;
}
Michael@Belgium (For the idea).
Download:
.zip: http://blackbanks.net/samp/anti-camp.zip
Pastebin: http://pastebin.com/xxrQuRBL