bueno aca les dejo algo simple pero ke sirve. un anti-drive_by creado por mi, consiste en kickear al drivero.
CODIGOS:
////////////////////////////////////////////////////////////////////////////////
/* Simple Sistema Anti-Drive_by
Creado por JurgeN
Kick al drivero */
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#include <a_samp>
#define COLOR_RED 0xFF4646FF
forward Float:GetDistanceBetweenPlayers(p1,p2);
////////////////////////////////////////////////////////////////////////////////
public OnPlayerDeath(playerid, killerid, reason)
{
new string[ 256 ];
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER && (reason == WEAPON_TEC9 || reason == WEAPON_UZI || reason == WEAPON_MP5) && GetDistanceBetweenPlayers(playerid,killerid) < 100)
{
new playrname[ MAX_PLAYER_NAME ];
GetPlayerName(playerid, playrname, sizeof(playrname));
format(string,256,"*** %s(id: %d) Ah sido kickeado del servidor (razon: DriveBy).", playrname, playerid);
SendClientMessageToAll( COLOR_RED, string );
Kick(killerid);
}
return 1;
}
////////////////////////////////////////////////////////////////////////////////
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
SI QUIEREN EL PWN ACA:
Simple Anti-Drive_by