28.12.2010, 06:05
How to stop the spamming? When i drive over "120" then i get spammed this:
Yo man! Slow down!!!
The speed limit is 120! so slow down!!!
I want it like: When i drive over 120 then i get the message ONE time.
The whole filter script
Yo man! Slow down!!!
The speed limit is 120! so slow down!!!
I want it like: When i drive over 120 then i get the message ONE time.
The whole filter script
pawn Код:
#include <a_samp>
forward Speed(playerid);
public OnFilterScriptInit()
{
SetTimer("Speed",1000,1);
return 1;
}
public Speed(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetVehicleSpeed(i) > 120)
{
SendClientMessage(playerid,0xFF0005FF,"Yo man! Slow down!!!");
SendClientMessage(playerid,0xFF0005FF,"The speed limit is 120! so slow down!!!");
return 1;
}
}
return 1;
}
stock GetVehicleSpeed(i)
{
new Float: x, Float: y, Float: z;
GetVehicleVelocity(i, x, y, z);
return floatround((floatmul(floatsqroot(floatpower(x, 2.0) + floatpower(y, 2.0) + floatpower(z, 2.0)), 100.0) / 0.4463), floatround_floor);
}