SA-MP Forums Archive
[HELP] Anti Driveby - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Anti Driveby (/showthread.php?tid=199221)



[HELP] Anti Driveby + Mute Bug - Larsey123IsMe - 14.12.2010

i = [Lvrcr]Larsey123
him = Mercedes230

When 'i' driveby 'him' then it says that 'him' driveby'ed

[ame="http://www.youtube.com/watch?v=VdcTFhJcQBg"]Video Of Problem[/ame]

pawn Код:
#include <a_samp>

public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerState(killerid) == 2)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            new name[MAX_PLAYER_NAME], string[44];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s(%d) do NOT driveby",name ,playerid);
            SendClientMessageToAll(0xFFC4E0AA, string);
            return 1;
        }
    }
    return 1;
}



Re: [HELP] Anti Driveby - iFriSki - 14.12.2010

I believe you should tell the killer (killerid), not the one who died.

playerid = the one who died
killerid = the one who killed someone

pawn Код:
#include <a_samp>

public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerState(killerid) == 2)
    {
        if(!IsPlayerInAnyVehicle(killerid))
        {
            new name[MAX_PLAYER_NAME], string[44];
            GetPlayerName(killerid, name, sizeof(name));
            format(string, sizeof(string), "%s(%d) do NOT driveby",name ,killerid);
            SendClientMessageToAll(0xFFC4E0AA, string);
            return 1;
        }
    }
    return 1;
}



Re: [HELP] Anti Driveby - Larsey123IsMe - 14.12.2010

Thanks, That work

and i got an other question: My mute is bugged - It mute me instead of the player i clicked on =/


pawn Код:
new Mute[MAX_PLAYERS];
forward Unmute(playerid);
pawn Код:
else if(dialogid == 16)
    {
        if(response)
        {
            new playerwhogotmuted[MAX_PLAYER_NAME], string[128];
            GetPlayerName(adminPlayer[playerid], playerwhogotmuted, sizeof(playerwhogotmuted));
            format(string, sizeof(string), "**(ADMIN MUTE)** %s(%d) %s",playerwhogotmuted, playerid, inputtext);
            SendClientMessageToAll(COLOR_ADMINORANGE, string);
            adminPlayer[playerid] = 0;
            //Mute
            Mute[adminPlayer[playerid]] = 1;
            adminPlayer[playerid] = 0;
            //Timer
            SetTimer("Unmute",120000 ,false);
        } else return SendClientMessage(playerid, COLOR_ADMINRED, "Error: You have cancelled the Mute Menu.");
    }
pawn Код:
public Unmute(playerid)
{
    new playerwhogotmuted[MAX_PLAYER_NAME], string[128];
    GetPlayerName(adminPlayer[playerid], playerwhogotmuted, sizeof(playerwhogotmuted));
    format(string, sizeof(string), "**(ADMIN UNMUTE)** %s(%d), Read /rules /pc /commands",playerwhogotmuted, playerid);
    SendClientMessageToAll(COLOR_ADMINORANGE, string);
    Mute[adminPlayer[playerid]] = 0;
    adminPlayer[playerid] = 0;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(Mute[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_ADMINMUTE, "You Are Muted. You Cannot Chat");
        return 0;
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    Mute[playerid] = 0;
    return 1;
}



Re: [HELP] Anti Driveby - Retardedwolf - 14.12.2010

No offense Larsey, you're just calling everyone to help if something doesn't work.

Try fixing it yourself first and learn from your mistakes.


Re: [HELP] Anti Driveby - Larsey123IsMe - 14.12.2010

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
No offense Larsey, you're just calling everyone to help if something doesn't work.

Try fixing it yourself first and learn from your mistakes.
Ye Ye i know im always calling for help Sorry about that, but i never get it to work
After i have tried for like 2-3 to get it to work.. then ill ask, i have searched evrywhere but dont find anytihin