public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(pInfo[playerid][Team] != TEAM_COPS || pInfo[playerid][Team] != TEAM_MEDICS)
{
if(GetPlayerVehicleID(playerid) == Ambulance[0] || Ambulance[1])
{
SendClientMessage(playerid, Orange, "Felony commited,stolen law enforcement vehicle(+2 wanted level)");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+2);
for(new cop; cop < MAX_PLAYERS; cop++)
{
if(IsPlayerConnected(cop))
{
if(pInfo[cop][Team] == TEAM_COPS)
{
format(gstring,256,"Felony commited: the player %s has stolen a law enforcement vehicle.",pName(playerid));
SendClientMessage(cop,lBlue,gstring);
}
}
}
}
}
}
return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(pInfo[playerid][Team] != TEAM_COPS || pInfo[playerid][Team] != TEAM_MEDICS)
{
if(GetPlayerVehicleID(playerid) == Ambulance[0] || Ambulance[1])
{
SendClientMessage(playerid, Orange, "Felony commited,stolen law enforcement vehicle(+2 wanted level)");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+2);
for(new cop; cop < MAX_PLAYERS; cop++)
{
if(IsPlayerConnected(cop))
{
if(pInfo[cop][Team] == TEAM_COPS)
{
format(gstring,256,"Felony commited: the player %s has stolen a law enforcement vehicle.",pName(playerid));
SendClientMessage(cop,lBlue,gstring);
return 1;
}
}
}
}
}
return 1;
}
return 1;
}
pawn Код:
|
public OnPlayerStateChange(playerid,newstate,oldstate) { if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER) // not important but good to write, this is not the problem though. { if(pInfo[playerid][Team] == TEAM_COPS || pInfo[playerid][Team] == TEAM_MEDICS) return 1; if(GetPlayerVehicleID(playerid) == Ambulance[0] || Ambulance[1]) { SendClientMessage(playerid, Orange, "Felony commited,stolen law enforcement vehicle(+2 wanted level)"); SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+2); for(new cop; cop < MAX_PLAYERS; cop++) { if(IsPlayerConnected(cop)) { if(pInfo[cop][Team] == TEAM_COPS) { format(gstring,256,"Felony commited: the player %s has stolen a law enforcement vehicle.",pName(playerid)); SendClientMessage(cop,lBlue,gstring); } } } } } return 1; }
public OnPlayerEnterVehicle(playerid,vehicleid) { if(pInfo[playerid][Team] == TEAM_COPS || pInfo[playerid][Team] == TEAM_MEDICS) return 1; if(vehicleid == Ambulance[0] || Ambulance[1]) { SendClientMessage(playerid, Orange, "Felony commited,stolen law enforcement vehicle(+2 wanted level)"); SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+2); for(new cop; cop < MAX_PLAYERS; cop++) { if(IsPlayerConnected(cop)) { if(pInfo[cop][Team] == TEAM_COPS) { format(gstring,256,"Felony commited: the player %s has stolen a law enforcement vehicle.",pName(playerid)); SendClientMessage(cop,lBlue,gstring); } } } } return 1; }
if(pInfo[playerid][Team] != TEAM_COPS || pInfo[playerid][Team] != TEAM_MEDICS)
if(pInfo[playerid][Team] != TEAM_COPS && pInfo[playerid][Team] != TEAM_MEDICS)