SA-MP Forums Archive
Anti_Speed problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti_Speed problem (/showthread.php?tid=378130)



Anti_Speed problem - Akcent_Voltaj - 16.09.2012

so look it doesent work i put an hack on my server to see and it doesent appear message and doesent kick me..the server restarts..

PHP код:
#define Name:%1(%2) forward %1(%2); public %1(%2) 
PHP код:
Name:Antisp(playerid)
                    {
                       if(
GetPlayerSpeed(playerid) > 210)  // if it is above.
                       
{
                         
SendClientMessage(playerid, -1"<< Anti-Speed: %s a primit Kick de la Anti-Speed >>");  // will be displayed this message
                         
Kick(playerid); // Then will kick the player.
                       
}
                       return 
1;
                    } 
help please!


Re: Anti_Speed problem - Akcent_Voltaj - 16.09.2012

anyone?


Re: Anti_Speed problem - doreto - 16.09.2012

show your "GetPlayerSpeed" function


Re: Anti_Speed problem - ViniBorn - 16.09.2012

pawn Код:
Name:Antisp(playerid)
{
    if(GetPlayerSpeed(playerid) > 210)  // if it is above.
    {
        SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>");  // will be displayed this message
        Kick(playerid); // Then will kick the player.
    }
    return 1;
}



Re: Anti_Speed problem - SuperViper - 16.09.2012

pawn Код:
public OnGameModeInit()
{
    SetTimer("Antisp", 2000, 1);
    return 1;
}

forward Antisp();
public Antisp()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(GetPlayerSpeed(playerid) > 210)  // if it is above.
        {
            SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>");  // will be displayed this message
            Kick(playerid); // Then will kick the player.
        }
    }

    return 1;
}



Re: Anti_Speed problem - Akcent_Voltaj - 20.09.2012

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
public OnGameModeInit()
{
    SetTimer("Antisp", 2000, 1);
    return 1;
}

forward Antisp();
public Antisp()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(GetPlayerSpeed(playerid) > 210)  // if it is above.
        {
            SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>");  // will be displayed this message
            Kick(playerid); // Then will kick the player.
        }
    }

    return 1;
}
no message the server restarts!


Re: Anti_Speed problem - ikkentim - 20.09.2012

Use the IsPlayerConnected function before checking speed.


Re: Anti_Speed problem - Lordzy - 20.09.2012

Try this
pawn Код:
public OnPlayerUpdate(playerid)
{
   if(GetPlayerSpeed(playerid) > 210)
   {
     SendClientMessage(playerid, 0xFF0000, "Anti-Speed:You're kicked for high speed.");
     Kick(playerid);
   }
   return 1;
}
Not Tested.