Anti Car Surfing -
rootcause - 22.03.2015
This include adds 4 things, 3 functions and a callback.
Код:
stock SetVehicleSurfable(modelid, bool: set);
stock SetPlayerSurfImmunity(playerid, bool: immunity);
stock GetPlayerSurfImmunity(playerid);
forward OnPlayerCarSurf(playerid, vehicleid);
You can prevent car surfing on all vehicles or for certain models using SetVehicleSurfable function. By default, all vehicle models (including boats) are not allowed to car surf on.
OnPlayerCarSurf will get called if you add the public to your script and you can do whatever you want to the player from there, if you don't add it to your script players will get slapped when they car surf.
Also you can define SURF_MIN_SPEED before including antisurf. By default if a vehicle's speed is lower than 25, surfers won't get slapped or callback won't get called. You can change that using SURF_MIN_SPEED.
[NEW] You can give immunity to players now using SetPlayerSurfImmunity. If they've been given immunity, when they car surf nothing will happen. You can get a players immunity state using GetPlayerSurfImmunity.
Few Examples:
Код:
#include <antisurf>
public OnPlayerCarSurf(playerid, vehicleid)
{
// take $250 from the player
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, 0xFF0000FF, "Car surfing is not allowed on this server, $250 taken.");
return 1;
}
Код:
#include <antisurf>
public OnPlayerCarSurf(playerid, vehicleid)
{
// stop the vehicle player surfed on
SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0);
return 1;
}
Код:
#define SURF_MIN_SPEED 120.0
#include <antisurf>
public OnPlayerCarSurf(playerid, vehicleid)
{
// this callback only gets called when a player surfs on a 120+ speed vehicle because of SURF_MIN_SPEED.
// kill the player because vehicle the player was surfing on was too fast
SetPlayerHealth(playerid, -1.0);
SendClientMessage(playerid, -1, "You fell from the vehicle.");
return 1;
}
Changelog:
23.03.2015:
- Added SetPlayerSurfImmunity and GetPlayerSurfImmunity. Thanks Abagail for your suggestion.
Re: Anti Car Surfing -
Naruto_Emilio - 22.03.2015
Good job! you're doing good with your systems.
Re: Anti Car Surfing -
Abagail - 22.03.2015
I'd recommend adding more options to disabling checks for a certain player. Example,
pawn Код:
stock SetPlayerSurfImmune(playerid, bool: immunity)
Re: Anti Car Surfing -
Mokless - 22.03.2015
Good job!
i like it
Re: Anti Car Surfing -
rootcause - 23.03.2015
Quote:
Originally Posted by Abagail
I'd recommend adding more options to disabling checks for a certain player. Example,
pawn Код:
stock SetPlayerSurfImmune(playerid, bool: immunity)
|
Added, thanks for the suggestion!
New links are on the first post.
Re: Anti Car Surfing -
thaKing - 23.03.2015
It's good, but better would be if you can surf on bikes and pickups. More realistic. You can make exception for bikes (not motorbikes) and pickups.
Re: Anti Car Surfing -
SHFaCeBook - 02.04.2015
Nice , Good Work
can you make it in Command ) when player surf in car , and a one is drive car , when he write : Ex : /ejectsurf [ID] , and he will get slap. if he surf in car
Re: Anti Car Surfing -
FILIX - 14.07.2015
Nice Work ,But i need ,Anti DM vehicle ,Mean if Someone DM car he will slap
Re: Anti Car Surfing -
FILIX - 14.07.2015
mean i want CarSurfing with weapon ,
,Anti DM vehicle ,Mean if Someone DM car he will slap
Re: Anti Car Surfing -
KayJ - 11.08.2015
CLICK HERE FOR A MIRROR PASTE!