[Problema] Comando /ver id - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Problema] Comando /ver id (
/showthread.php?tid=537043)
[Problema] Comando /ver id -
MrNatrio - 13.09.2014
Buenas,
He creado un comando que pones
/ver id <Nombre_Apellidos> y luego te dice cual es su ID.
Este es el comando:
pawn Код:
CMD:ver(playerid, params[]) //Comando: /ver id <Nombre_Apellido>
{
new string[100],name[16], cname[21];
if(strcmp(params,"id",true) == 0)
{
if(sscanf(params,"s[21]",cname)) return SendClientMessage(playerid,blue,"Uso: /ver id <Nombre_Apellido>");
{
for(new i; i<MAX_PLAYER_NAME; i++)
{
GetPlayerName(i,name,sizeof(name));
if(name != cname) return SendClientMessage(playerid,red,"No se encontrу la ID"); //lнnia 2215
format(string,sizeof(string),"El jugador: %s tiene la ID: %d",cname, i);
SendClientMessage(playerid,yellow,string);
}
}
}
return 1;
}
El problema es que me dice este error:
Quote:
(2215) : error 033: array must be indexed (variable "name")
1 Error.
|
He hecho otros comandos que tambiйn guardaba el nombre de otro jugador en un array pero no me salнa este error.
їQuй estб mal o quй le falta?
Gracias de antemano.
Respuesta: [Problema] Comando /ver id -
Stront - 13.09.2014
if(strcmp(name, cname, false) != 0) return SendClientMessage(playerid,red,"No se encontrу la ID"); //lнnia 2215
Re: Respuesta: [Problema] Comando /ver id -
MrNatrio - 13.09.2014
Quote:
Originally Posted by Stront
if(strcmp(name, cname, false) != 0) return SendClientMessage(playerid,red,"No se encontrу la ID"); //lнnia 2215
|
Muchas gracias, me sirviу.