Need help! - Crime - Wanted Levels
#1

Hi all, I have a CNR Server. I need help with crime - wanted levels. How to make if a civilian steals law enforcement vehicles they will get wanted levels and how to make if a civilian assaults/kill police they will get wanted levels?

Please tell me how to do it explain clearly one by one so I can understand.
Reply
#2

This will help you

https://sampwiki.blast.hk/wiki/SetPlayerWantedLevel
https://sampwiki.blast.hk/wiki/GetPlayerWantedLevel
Reply
#3

Thanks for the reply. I'm talking about how to make civilians get wanted levels if they steal law enforcement vehicles and assaulting/kill police or other civs.
Reply
#4

you can use OnPlayerStateChange or OnPlayerEnterVehicle and for the assaulting you can use OnPlayerTakeDamage
Reply
#5

Quote:
Originally Posted by pds2012
Посмотреть сообщение
you can use OnPlayerStateChange or OnPlayerEnterVehicle and for the assaulting you can use OnPlayerTakeDamage
Can you give me one example of the ''script''?
Reply
#6

here you go some quick examples just change the gTeam to your own team variable and stuff that you need to change in the code

Here You Go
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && gTeam[playerid] == TEAM_CIVILIAN)
    {
        new
            string[128],
            name[24],
            pname[24]
        ;
        GetPlayerName(issuerid, name, sizeof(name));
        GetPlayerName(playerid, pname, sizeof(pname));
        //
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+2);
        format(string,sizeof(string),"[ASSAULT] %s[%d] is firing gun shots to %s[%d]",name,issuerid,pname,playerid);
        SendClientMessageToAll(-1,string);
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {  
        new vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 416 && gTeam[playerid] == TEAM_CIVILIAN)
        {
        new
            string[128],
            pname[24]
        ;
            GetPlayerName(playerid, pname, sizeof(pname));
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+2);
            format(string,sizeof(string),"[GTA] %s[%d] has stolen a Ambulance. Police watch out!",pname);
            SendClientMessageToAll(-1,string);
       
        }
    }
    return 1;
}
PS i did not use OnPlayerEnterVehicle because OnPlayerStateChange is what people always use for CnR
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)