Help With Text Spmming - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help With Text Spmming (
/showthread.php?tid=71671)
Help With Text Spmming -
StrickenKid - 03.04.2009
when someone enters a car, it just spams the message to them, how can i fix it??
pawn Код:
if(PlayerCar[playerid] != CarID && gClass[playerid] == CLASS_CIVIL)
{
if(CarID == 416 || CarID == 523 || CarID == 427 || CarID == 490 || CarID == 407 || CarID == 544 || CarID == 528 || CarID == 596
|| CarID == 598 || CarID == 597 || CarID == 599 || CarID == 601 && gClass[playerid] == CLASS_CIVIL)
{
new string[256];
if(WantedLevel[playerid] < 10){ WantedLevel[playerid] += 4; SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+2); }
else { WantedLevel[playerid] += 0; SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+0); }
SetPlayerColorToWL(playerid);
new str1[256],str2[256];
format(str1,sizeof(str1),"(DISPATCH) [CRIME IN PROGRESS] Suspect: %s (%d) | Crime: Law Enforcement Vehicle Theft",ReturnPlayerName(playerid),playerid);
new current_zone = player_zone[playerid];
format(str2,sizeof(str2),"Location: %s. All Units Respond Emediatly!",zones[current_zone][zone_name]);
SendCopMsg(str1);
SendCopMsg(str2);
format(string, sizeof(string),"You Have Committed A Crime (Law Enforcement Vehicle Theft) - Wanted Level %d",WantedLevel[playerid]);
SendClientMessage(playerid,GetPlayerColor(playerid),string);
PlayerCar[playerid] = CarID;
}
else
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
for (new i=0; i<MAX_PLAYERS; i++)
{
if (PlayerToPoint(30.0,i,X,Y,Z) && gClass[i] == CLASS_LAWENFORCEMENT )
{
new string[256];
if(WantedLevel[playerid] < 10){ WantedLevel[playerid] += 1; SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1); }
else { WantedLevel[playerid] += 0; SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+0); }
SetPlayerColorToWL(playerid);
new str1[256],str2[256];
format(str1,sizeof(str1),"(DISPATCH) [CRIME IN PROGRESS] Suspect: %s (%d) | Crime: Vehicle Theft",ReturnPlayerName(playerid),playerid);
new current_zone = player_zone[playerid];
format(str2,sizeof(str2),"Location: %s. All Units Respond Emediatly!",zones[current_zone][zone_name]);
SendCopMsg(str1);
SendCopMsg(str2);
format(string, sizeof(string),"You Have Committed A Crime (Vehicle Theft) - Wanted Level %d",WantedLevel[playerid]);
SendClientMessage(playerid,GetPlayerColor(playerid),string);
PlayerCar[playerid] = CarID;
}
else
{
SendClientMessage(playerid,GetPlayerColor(playerid),"You Have Committed A Crime (Vehicle Theft)");
PlayerCar[playerid] = CarID;
}
}
}
}
}
thanks for any help!
Re: Help With Text Spmming -
Shellegg - 03.04.2009
add a return 1; and try
Re: Help With Text Spmming -
StrickenKid - 03.04.2009
ok ill try now
EDIT: return 1 is in there, i just didn't copy that over onto the post....
Re: Help With Text Spmming -
yezizhu - 03.04.2009
Please show ur SendCopMsg code and other code besides the callback you infer on ur topic(OnPlayerEnterVehicle or OnPlayerStateChange?)^^
Re: Help With Text Spmming -
On_Top_Non_Stop - 03.04.2009
Use OnPlayerStateChange since OnPlayerEnterVehicle is fired every time you hit the key you use to enter a vehicle.