Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- NÃO RETIRE OS CREDITOS
- POR WEVERTON
- PLAGIO E CRIME...
- VISITE NOSSO SITE: http://www.sampknd.com/
- SAMP KND MELHOR BLOG DE SAMP DO BRASIL
- */
- #include a_samp
- #include dini
- new aviso[MAX_PLAYERS];
- #define SPEEDLIMITER 151
- public OnFilterScriptInit()
- {
- SetTimer("Speed",1,true);
- printf("FILTERSCRIPT FEITO POR WEVERTON Skype: scriptsamp");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- stock GetPlayerSpeed(playerid)
- {
- new Float:ST[4];
- if(IsPlayerInAnyVehicle(playerid))
- GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
- else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
- ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
- return floatround(ST[3]);
- }
- public OnPlayerConnect(playerid)
- {
- new file[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(file,sizeof(file),"SpeedLimiter/%s.ini",name);
- if(!dini_Exists(file)) return dini_Create(file);
- aviso[playerid] = dini_Int(file,"Avisos");
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- SendClientMessage(playerid,-1,"Servidor com sistema de Anti Velocidade...BY: Weverton");
- if(aviso[playerid] >= 1)
- {
- new file[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- format(file,sizeof(file),"SpeedLimiter/%s.ini",name);
- dini_IntSet(file,"Avisos",aviso[playerid]);
- }
- return 1;
- }
- forward Speed(playerid);
- public Speed(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new string[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- new sp; sp = GetPlayerSpeed(playerid);
- if(sp >= SPEEDLIMITER)
- {
- if(aviso[playerid] == 0)
- {
- format(string,sizeof(string),"[AVISO 1/3] %s ultrapassou o limite de velocidade o servidor e foi kickado[%d km/h]",name,sp);
- SendClientMessageToAll(playerid,0x80FF00AA,string);
- aviso[playerid] += 1;
- Kick(playerid);
- return 1;
- }
- else if(aviso[playerid] == 1)
- {
- format(string,sizeof(string),"[AVISO 2/3] %s ultrapassou o limite de velocidade o servidor e foi kickado[%d km/h]",name,sp);
- SendClientMessageToAll(playerid,0x80FF00AA,string);
- aviso[playerid] += 1;
- Kick(playerid);
- return 1;
- }
- else if(aviso[playerid] == 2)
- {
- format(string,sizeof(string),"[AVISO 3/3] %s ultrapassou o limite de velocidade e foi banido",name);
- SendClientMessageToAll(playerid,0x80FF00AA,string);
- aviso[playerid] += 1;
- format(string,sizeof(string)," %s foi banido por atigir a velocidade maxima do servidor [%d km/h]",name,sp);
- SendClientMessage(playerid,-1,string);
- Ban(playerid);
- aviso[playerid] = 0;
- return 1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement