Anti Vehicle Abusive kill xD
#1

Can any one help with this ?
i tried to create it with kill spree but it wont work

I mean like if a player is in rhino and if he kills 5 ppl continuously he will be ejected from the vehicle and he needs to wait 2 minutes before going into the any rhino again!
Reply
#2

pawn Код:
new carkill[MAX_PLAYERS], bool:rhinod[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInVehicle(killerid, 432)) // is he in rhino?
    {
        carkill[killerid]++;
    }
   
    if(carkill[killerid] >= 5) // he killed more than 5 people with rhino
    {
        SetTimerEx("RhinoDisabled", 1000*60*2, false, "d", killerid)
        RemovePlayerFromVehicle(killerid);
        rhinod[killerid] = true;
        carkill[killerid] = 0; // the carkill gets reset
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger == 0) // is he driver?
    {
        if(vehicleid == 432) // is it a rhino?
        {
            if(rhinod[playerid] == true) // is rhino disabled for him?
            {
                RemovePlayerFromVehicle(playerid); // remove him from it
            }
        }
    }
    return 1;
}

forward RhinoDisabled(playerid)
public RhinoDisabled(playerid)
{
    rhinod[playerid] = false;
    return 1;
}
Reply
#3

Thx but it disables the rhino for him only when he kills 5 ppl right ?
Reply
#4

Yes (8 chars.)
Reply
#5

two errors
PHP код:
E:\samp03asvr_R8_win32\gamemodes\newupdateCod.pwn(4418) : error 001expected token";"but found "-identifier-"
E:\samp03asvr_R8_win32\gamemodes\newupdateCod.pwn(4569) : error 001expected token";"but found "public" 
And The lines are

RemovePlayerFromVehicle(killerid);
and
public RhinoDisabled(playerid)
Reply
#6

pawn Код:
SetTimerEx("RhinoDisabled", 1000*60*2, false, "d", killerid)
to
pawn Код:
SetTimerEx("RhinoDisabled", 1000*60*2, false, "d", killerid);
and
pawn Код:
forward RhinoDisabled(playerid)
to
pawn Код:
forward RhinoDisabled(playerid);
Reply
#7

thx Thank you very much worked good no errors
Reply
#8

i tried it but nothing happens after 5 kills
Reply
#9

pawn Код:
new carkill[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    carkill[playerid]=false;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != (-1))
        if(IsPlayerInAnyVehicle(killerid))
            if(!GetPlayerVehicleSeat(killerid))
                if(GetVehicleModel(GetPlayerVehicleID(killerid)) == 432)) // is he in rhino?
                    carkill[killerid]++;
    if(carkill[killerid] >= 5) // he killed more than 5 people with rhino
    {
        SetTimerEx("RhinoDisabled", 120000, false, "d", killerid);
        RemovePlayerFromVehicle(killerid);
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 432) // is it a rhino?
        if(carkill[playerid]) // is rhino disabled for him?
        {
            new Float:Pos[3];
            GetPlayerPos(playerid,Pos[0],Pos[1],Pos2]);
            SetPlayerPos(playerid,Pos[0],Pos[1],Pos2]+2.0);
        }
    return 1;
}

forward RhinoDisabled(p);
public RhinoDisabled(p) return carkill[p]=false;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)