[HELP]Speed Camera Code -
[UG]Scripter - 18.04.2011
Hey all,
My I have created some speedcamera Code, But I want it so that if the player is in Team_Cop then they will not get fined, But I can't seem to get it to work.....
here's my code:
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(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;
}
Re: [HELP]Speed Camera Code -
iJumbo - 18.04.2011
whats is your team name exactly?
Re: [HELP]Speed Camera Code -
[UG]Scripter - 18.04.2011
Team_SFPD
Re: [HELP]Speed Camera Code -
[UG]Scripter - 19.04.2011
Bump.. No reply.. Still unsolved.
Re: [HELP]Speed Camera Code -
[UG]Scripter - 24.04.2011
BUMP
Re: [HELP]Speed Camera Code -
captainjohn - 24.04.2011
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;
}