SA-MP Forums Archive
Anti Vehicle Abusive kill xD - 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: Anti Vehicle Abusive kill xD (/showthread.php?tid=176141)



Anti Vehicle Abusive kill xD - James124 - 12.09.2010

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!


Re: Anti Vehicle Abusive kill xD - Claude - 12.09.2010

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;
}



Re: Anti Vehicle Abusive kill xD - James124 - 12.09.2010

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


Re: Anti Vehicle Abusive kill xD - Claude - 12.09.2010

Yes (8 chars.)


Re: Anti Vehicle Abusive kill xD - James124 - 12.09.2010

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)


Re: Anti Vehicle Abusive kill xD - Claude - 12.09.2010

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);



Re: Anti Vehicle Abusive kill xD - James124 - 12.09.2010

thx Thank you very much worked good no errors


Re: Anti Vehicle Abusive kill xD - James124 - 12.09.2010

i tried it but nothing happens after 5 kills


Re: Anti Vehicle Abusive kill xD - Jefff - 12.09.2010

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;