Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] CMD /id

 
  • 0 Vote(s) - 0 Average
Pawn CMD /id
Hitler
Offline

Burgershot Member
Posts: 19
Threads: 12
Joined: Feb 2021
Reputation: 0
#1
2021-03-01, 10:52 PM
Español: Tengo un problema con este comando, cuando uso /id aparece el id del jugador y otros datos (ping, fps, pk), también aparece la hora y fecha, el problema es que aveces muestra solo la hora y fecha y otras veces muestra la id y los otros datos (ping, fps, pk)

English: I have a problem with this command, when I use / id it shows the id of the player and other data (ping, fps, pk), it also shows the time and date, the problem is that sometimes it shows only the time and date and other times it shows the id and the other data (ping, fps, pk)

Code:
CMD:id(playerid,params[])
{
new jugador;
if(sscanf(params, "r", jugador)) return SendClientMessage(playerid, -1, "Usa: /id [ID/Nombre]");
if (!IsPlayerConnected(jugador)) return SendClientMessage(playerid,GRIS,"No se encontró ningún jugador");
new Float:pPacket = GetPlayerPacketLoss(jugador);
new string[200];
format(string,sizeof(string), "Nombre: %s ID: %d FPS: %d Ping: %d | PacketLoss: %.1f%%",Nombre(jugador),jugador,FPS[jugador],GetPlayerPing(jugador),pPacket);
SendClientMessage(playerid,0xffffffff,string);
new hora,minuto,segundo,d,m,a;
getdate(a, m, d);
gettime(hora, minuto,segundo);
new string2[200];
format(string2,sizeof(string2), "Hora: %d:%d:%d Fecha: %d/%d/%d",hora,minuto,segundo,d,m,a);
SendClientMessage(playerid,0xffffffff,string2);
return 1;
}
Programador básico
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#2
2021-03-01, 11:49 PM
I'd really help you, but I don't understand anything from google-translate
Kevinas
Offline

Burgershot Member
Posts: 7
Threads: 3
Joined: Feb 2021
Reputation: 0
#3
2021-03-05, 07:40 AM (This post was last modified: 2021-03-05, 07:58 AM by Kevinas.)
(2021-03-01, 10:52 PM)Hitler Wrote: Español: Tengo un problema con este comando, cuando uso /id aparece el id del jugador y otros datos (ping, fps, pk), también aparece la hora y fecha, el problema es que aveces muestra solo la hora y fecha y otras veces muestra la id y los otros datos (ping, fps, pk)

English: I have a problem with this command, when I use / id it shows the id of the player and other data (ping, fps, pk), it also shows the time and date, the problem is that sometimes it shows only the time and date and other times it shows the id and the other data (ping, fps, pk)

Code:
CMD:id(playerid,params[])
{
new jugador;
if(sscanf(params, "r", jugador)) return SendClientMessage(playerid, -1, "Usa: /id [ID/Nombre]");
if (!IsPlayerConnected(jugador)) return SendClientMessage(playerid,GRIS,"No se encontró ningún jugador");
new Float:pPacket = GetPlayerPacketLoss(jugador);
new string[200];
format(string,sizeof(string), "Nombre: %s ID: %d FPS: %d Ping: %d | PacketLoss: %.1f%%",Nombre(jugador),jugador,FPS[jugador],GetPlayerPing(jugador),pPacket);
SendClientMessage(playerid,0xffffffff,string);
new hora,minuto,segundo,d,m,a;
getdate(a, m, d);
gettime(hora, minuto,segundo);
new string2[200];
format(string2,sizeof(string2), "Hora: %d:%d:%d Fecha: %d/%d/%d",hora,minuto,segundo,d,m,a);
SendClientMessage(playerid,0xffffffff,string2);
return 1;
}

Where do you define "Nombre"? try using getplayername(jugador, dest, len); and type in the dest as the first param instead of "Nombre(jugador)"

EDIT: also checking if(jugador==INVALID_PLAYER_ID) return ... might help
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#4
2021-03-05, 09:20 AM
PHP Code:
CMD:id(playerid, params[]) {
new 
jugador;
if (
sscanf(params, "r", jugador)) return SendClientMessage(playerid, -1, "Usa: /id [ID/Nombre]");
if (!
IsPlayerConnected(jugador)) return SendClientMessage(playerid, GRIS, "No se encontró ningún jugador");
new 
string[144], hora, minuto, segundo, d, m, a;
        getdate(a, m, d);
gettime(hora, minuto, segundo);
format(string, sizeof(string), "Nombre: %s ID: %d FPS: %d Ping: %d | PacketLoss: %.2f%%", Nombre(jugador), jugador, FPS[jugador], GetPlayerPing(jugador), GetPlayerPacketLoss(jugador));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "Hora: %d:%d:%d Fecha: %d/%d/%d", hora, minuto, segundo, d, m, a);
SendClientMessage(playerid, -1, string);
return 
1;
} 
Fiame
Offline

Burgershot Member
Posts: 2
Threads: 1
Joined: Nov 2020
Reputation: 0
Location: Croatia
#5
2021-03-10, 04:25 PM
From where did you get FPS plugin?
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#6
2021-03-10, 04:40 PM
(2021-03-10, 04:25 PM)Fiame Wrote: From where did you get FPS plugin?

you can get the player’s FPS by DrunkLevel at OnPlayerUpdate
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode