Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- VISITE NOSSO SITE: http://www.sampknd.com/
- VISITE NOSSO FACEBOOK: http://www.facebook.com/SampKnd
- SAMP KND MELHOR BLOG DE SAMP DO BRASIL
- */
- FilterScript criado a pedido do SkYpE...
- Créditos: Focaximubh(EU '-')
- Cantiliano_ = duduzinho (Me ajudou a testar o projeto e me deu idéia pra arruma uns errinhos O.o
- mlk tu é dms e ainda arrumo minha conexão pra usar o sa-mp sem hamachi :D)
- Zamaroht's (Pelo editor de TextDraws)
- SA-MP WiKi Pela explicação das funções:
- http://wiki.sa-mp.com/wiki/GetPlayerTargetPlayer
- http://wiki.sa-mp.com/wiki/GetPlayerPing
- http://wiki.sa-mp.com/wiki/CreatePlayerTextDraw
- ZeeX (Pelo ZCMD)
- Objetivo do FilterScript: Após mirar em algum player, o seu PING será imprimido
- na TextDraw aparecendo de forma totalmente dinâmica
- EX: Ping Alvo: 120
- Ping Alvo: 123
- Ping Alvo: 133
- Ou de acordo com o ping do player(os ping acima foi só exemplo nunca vi ping
- abaixo de 200 mais hje em dia suhausahs)
- Obrigado pela atenção de todos, peço desculpas por erros de lógica ou até
- falta de organização do código, estou disposto a receber críticas e dicas
- para a melhoria de projetos, apesar de extremamente simples.
- */
- #include <a_samp>
- #include <a_players>
- #include <zcmd>
- #include <sscanf2>
- new PlayerText:PlayerPingText[MAX_PLAYERS];
- public OnGameModeInit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" PlayerPingTextDraw by: Focaximubh");
- print("----------------------------------\n");
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerPingText[playerid] = CreatePlayerTextDraw(playerid, 7.000000, 322.000000, "Nenhum Alvo");
- PlayerTextDrawBackgroundColor(playerid, PlayerPingText[playerid], 255);
- PlayerTextDrawFont(playerid, PlayerPingText[playerid], 1);
- PlayerTextDrawLetterSize(playerid, PlayerPingText[playerid], 0.430000, 1.500000);
- PlayerTextDrawColor(playerid, PlayerPingText[playerid], -16776961);
- PlayerTextDrawSetOutline(playerid, PlayerPingText[playerid], 1);
- PlayerTextDrawSetProportional(playerid, PlayerPingText[playerid], 1);
- PlayerTextDrawUseBox(playerid, PlayerPingText[playerid], 1);
- PlayerTextDrawBoxColor(playerid, PlayerPingText[playerid], 0x90948DFF);
- PlayerTextDrawTextSize(playerid, PlayerPingText[playerid], 132.000000, -135.000000);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerTextDrawDestroy(playerid, PlayerPingText[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- PlayerTextDrawShow(playerid, PlayerPingText[playerid]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerTextDrawHide(playerid, PlayerPingText[playerid]);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new OutroPlayer = GetPlayerTargetPlayer(playerid);
- new OutroPplayer;
- new PlayerPingString[20];
- if(GetPlayerTeam(OutroPlayer) == GetPlayerTeam(playerid) && OutroPlayer != INVALID_PLAYER_ID)//Função retirada do SA-MP Wiki
- {
- format(PlayerPingString, sizeof(PlayerPingString), "~r~Ping Alvo: ~w~%i", GetPlayerPing(OutroPplayer));
- PlayerTextDrawSetString(playerid, PlayerPingText[playerid], PlayerPingString);
- }
- else
- {
- PlayerTextDrawSetString(playerid, PlayerPingText[playerid], "~r~Nenhum Alvo");
- }
- return 1;
- }
- CMD:meuping(playerid, params[])
- {
- new seuping[24];
- format(seuping, sizeof(seuping), "Seu ping agora é: %i", GetPlayerPing(playerid));
- SendClientMessage(playerid, -1, seuping);
- return 1;
- }
- CMD:pingdele(playerid, params[])
- {
- new id;
- if(sscanf(params,"i", id)) return SendClientMessage(playerid , -1, " Uso /pingdele [ID do player] ");
- if(IsPlayerConnected(id))
- {
- new PingDele = GetPlayerPing(id);
- new PingdoCara[24];
- format(PingdoCara, sizeof(PingdoCara), "O ping dele agora é: %i", PingDele);
- SendClientMessage(playerid, -1, PingdoCara);
- }
- else
- {
- SendClientMessage(playerid, -1, "Este Player Não está online no momento");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement