28.03.2013, 11:30
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
PS i did not use OnPlayerEnterVehicle because OnPlayerStateChange is what people always use for CnR
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;
}