Anti_Speed - problem
#1

i made a anti speed but doesnet give me kick and message please help!compiles fine no errors/warning but i dont gget kicked and message..

PHP код:
public Antisp(playerid)
                    {
                    if(
GetPlayerSpeed(playerid) > 100.0) return Kick(playerid);
                    
SendClientMessage(playeridCOLOR_LIGHTRED"Slow!!");
                    return 
1;
                    } 
Reply
#2

pawn Код:
public Antisp(playerid)
{
    if(GetPlayerSpeed(playerid) > 100.0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Slow!!");
        return Kick(playerid);
    }
}
Try this ї?
Reply
#3

Quote:
Originally Posted by Bu11Sh0t
Посмотреть сообщение
pawn Код:
public Antisp(playerid)
{
    if(GetPlayerSpeed(playerid) > 100.0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Slow!!");
        return Kick(playerid);
    }
(LINE 7701)>> }
Try this ї?
PHP код:
(7701) : warning 209: function "Antisp" should return a value 
Reply
#4

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
PHP код:
(7701) : warning 209: function "Antisp" should return a value 
pawn Код:
public Antisp(playerid)
{
    if(GetPlayerSpeed(playerid) > 100.0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Slow!!");
        Kick(playerid);
    }
    return 1;
}
Reply
#5

is this good??

PHP код:
stock GetPlayerSpeed(playerid)
                    {
                        new 
Float:ST[4];
                        if(
IsPlayerInAnyVehicle(playerid))
                        
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
                        else 
GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
                        
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
                        return 
floatround(ST[3]);
                    } 
Reply
#6

I have no idea if an anti-speed even would work through VELOCITY functions
pawn Код:
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    }
    else
    {
        GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    }
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
    return floatround(ST[3]);
}
Reply
#7

why doesent it work??
Reply
#8

Don't forget to use a settimer.

pawn Код:
// With this function will not be necessary make a foward /public each time.
#define Name:%1(%2) forward %1(%2); public %1(%2)


Name:Antisp(playerid)
{
   if(GetPlayerSpeed(playerid) > 100)  // if it is above.
   {
     SendClientMessage(playerid, -1, "Slow!!");  // will be displayed this message
     Kick(playerid); // Then will kick the player.
   }
   return 1;
}

stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 155.0;
    return floatround(ST[3]);
}
Reply
#9

Vehicles can go above 100 KM/H. An Infernus goes up to exactly 197 but a Hydra can go much higher. I recommend changing the check to 197 and ignoring the check if it's a Hydra.
Reply
#10

Not only hydra, also other vehicles like Helicopter and Planes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)