Problema con un comando -
Glimma - 16.09.2012
Buenas, al usar йste comando hacia otro usuario, la funciуn en vez de aplicarse hacia tal usuario, se aplica con el administrador que usa el mismo. Ejemplo, si yo soy ID 4, y le doy vida 0 al ID 7, /darvida 7 0, el comando no se lo da a йl, pero me lo da a mн..
pawn Код:
if(strcmp(cmd, "/darvida", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (JugadorInfo[playerid][jAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, GRIS, "Uso: /darvida [ID/Nombre] [health]");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
JugadorInfo[playerid][jVida] = health;
SetPlayerHealth(playa, health);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "Administraciуn: %s le coloco a %s la vida en %d.", sendername,giveplayer,health);
ABroadCast(ROJO,string,1);
printf("Administraciуn: %s le coloco a %s la vida de %d.", sendername,giveplayer,health);
}
}
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, " No puedes usar este comando!");
return 1;
}
}
return 1;
}
Re: Problema con un comando -
Miguel - 16.09.2012
pawn Код:
JugadorInfo[playerid][jVida] = health;
Allн creo que playerid deberнa ser "playa", aunque no se si eso tenga algo que ver...
Respuesta: Problema con un comando -
-[R]hysi- - 16.09.2012
Intenta cambiando
pawn Код:
SetPlayerHealth(playa, health);
JugadorInfo[playa][jVida] = health;
De esa manera dйjalo .
EDIT: Mientras escribнa ya contesto miguel.Dejar mi comentario como nulo xD.
Respuesta: Problema con un comando -
CaptainMactavish - 16.09.2012
їEstбs ciego?
pawn Код:
JugadorInfo[playerid][jVida] = health; //<<------------
SetPlayerHealth(playa, health);
Va asн:
pawn Код:
JugadorInfo[playa][jVida] = health; //<<------------
SetPlayerHealth(playa, health);
PD: Intenta solucionar tus problemas antes de venir a preguntar, sino es muy fбcil porque nosotros te hacemos el trabajo que TU deberнas hacer. Veo de 3 a 5 preguntas tuyas por dнa.