Car Ramming Prevention
#4

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) //Remove 'bodypart' if not using 0.3z
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            if(GetPlayerState(issuerid) == PLAYER_STATE_DRIVER)
            {
                if(weaponid == 49 || weaponid == 50)
                {
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(issuerid, x, y, z);
                    SetPlayerPos(issuerid, x, y, z + 5); //Slap the carparker
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x, y, z + 3); //Slap the player so they are no longer being carparked
                    SendClientMessage(issuerid, -1, "Carparking/Ramming is forbidden on this server.");
                }
            }
        }
    }
    return 1;
}
There are probably better methods than this and I'm not saying mine is the best alternative, but this code should have some effect.
Reply


Messages In This Thread
Car Ramming Prevention - by DJ_Shocker - 20.06.2014, 19:28
Re: Car Ramming Prevention - by Bek_Loking - 20.06.2014, 20:06
Re: Car Ramming Prevention - by DJ_Shocker - 21.06.2014, 00:13
Re: Car Ramming Prevention - by Threshold - 21.06.2014, 21:26

Forum Jump:


Users browsing this thread: 1 Guest(s)