Bom estгo puxando carro em um servidor de um colega, porйm eu tava arrumando um anti car spawn para ele, sу que o seguinte.
Ele sу funciona, se o player nгo tiver em carro algum, se ele entrar em uma bicicleta/moto/carro ele pode puxar atй esquecer da vida. Teria como alguйm criar um code pra mim ? .-. |
/*
_____ __ .__ _________ _________
/ _ \ _____/ |_|__| \_ ___ \_____ _______ / _____/____ _____ ______
/ /_\ \ / \ __\ | / \ \/\__ \\_ __ \ ______ \_____ \\__ \ / \\____ \
/ | \ | \ | | | \ \____/ __ \| | \/ /_____/ / \/ __ \| Y Y \ |_> >
\____|__ /___| /__| |__| \______ (____ /__| /_______ (____ /__|_| / __/
\/ \/ \/ \/ \/ \/ \/|__|
*/
#include <a_samp>
#define TimerFlood 1000
#define AlertFlood 3
// -- [ Variaveis ] --
new string [ 256 ];
new FloodAlert [ MAX_PLAYERS ];
new FloodTimer [ MAX_PLAYERS ];
public OnFilterScriptInit()
{
print("\n----------------------------------");
print(" **** [ FS ] Anti Car - Spam ****");
print(" **** By McLouco_Moto ****");
print("----------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
FloodAlert[playerid] = 0;
FloodTimer[playerid] = 0;
SendClientMessage(playerid, -1, "[ FS ] Filterscript Carregado ....");
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetTickCount() > FloodTimer[playerid])
{
FloodAlert[playerid] = 0;
}
FloodTimer[playerid] = GetTickCount() +TimerFlood;
FloodAlert[playerid]++;
if(FloodAlert[playerid] == AlertFlood)
{
format(string, sizeof(string), "{FFFF00}[ > ] O jogador %s foi kickado(a) por Anti-Bot. Motivo: Flood State", NomedoJogador(playerid));
SendClientMessageToAll(-1, string);
SendClientMessageToAll(-1, "{FF0000}Jogue com paciкncia e calmamente ...");
SetTimerEx("Kickar2", 1000, false, "i", playerid);
return 1;
}
}
return 1;
}
forward Kickar2(playerid);
////////////////////////
public Kickar2(playerid)
{
Kick(playerid);
}
stock NomedoJogador(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
public OnPlayerUpdate(playerid) {
if(GetPlayerVehicleID(playerid) != 0) {
if(GetPlayerVehicleID(playerid) != GetPVarInt(playerid, "Veiculo_Anterior")) {
if(GetPVarInt(playerid, "Troca_Veiculo") > gettime()) return BanEx(playerid, "Car Spam");
SetPVarInt(playerid, "Veiculo_Anterior", GetPlayerVehicleID(playerid));
SetPVarInt(playerid, "Troca_Veiculo", gettime() + 1);
}
}
return 1;
}