24.04.2011, 18:11
This probably won't work but try it,
pawn Код:
stock AddSpeedCamera(playerid, modelid, Float:xx, Float:yy, Float:zz, Float:ax, Float:ay, Float:az, radius, speed)
{
new fine[MAX_PLAYERS];
new str[256];
if(objectcreated!=maxobject)
{
CreateDynamicObject(modelid, xx, yy, zz, ax, ay,az);
objectcreated++;
}
if((distance1[playerid])>speed)
{
if(AntiTicketSpam[playerid] == 0)
{
if(gTeam[playerid] == TEAM_SFPD)
{
if(IsPlayerInCircle(playerid, xx, yy, radius) && GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
{
fine[playerid]= 200;
new string[125];
new playername[MAX_PLAYER_NAME];
GivePlayerMoney(playerid, -fine[playerid]);
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
format(str,sizeof(str), "You were driving faster than %d (Your speed was %d) MPH and got fined for $%d",speed, distance1[playerid] ,fine[playerid]);
SendClientMessage(playerid, COLOR_RED, str);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
SetTimerEx("PlayerAntiTicketSpam", 5000, false, "i", playerid);
GetPlayerName(playerid, playername, sizeof(playername));
format(string,sizeof(string),"Speed Alert: %s has been seen driveing %d in a %d zone. Location: %s",playername,distance1[playerid],speed,location);
SendClientMessageToFreq(0,string,!playerid);
AntiTicketSpam[playerid] = 1;
}
}
}
return 1;
}