Cual es el error en este comando? -
Jeree10 - 28.07.2015
El comando funciona pero no me cambia el mundo virtual, compila bien.
Код:
CMD:darmundo(playerid, params[])
{
if(Informacion[playerid][Identificado] == 0) return SendClientMessage(playerid,COLOR_ROJO,"* Debes estar identificado para usar este comando");
if(Informacion[playerid][Admin] <3) return SendClientMessage(playerid,COLOR_ROJO,"** Tu no eres administrador");
{
new id, mundo;
if(sscanf(params, "ud", id, mundo)) return SendClientMessage(playerid, -1, "Use: /darmundo [id] [mundo]");
if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ROJO,"* ID no encontrada");
SetPlayerVirtualWorld(id, mundo);
new str[150];
format(str,sizeof(str),"** Administrador %s (%d) a puesto tu mundo virtual en %d",Nume(playerid),playerid,mundo);
SendClientMessage(id,COLOR_CELESTE,str);
}
SendCommandToAdmins(playerid,"/darmundo");
return 1;
}
Respuesta: Cual es el error en este comando? -
Swedky - 28.07.2015
Intenta con йsto:
pawn Код:
CMD:darmundo(playerid, params[])
{
if(Informacion[playerid][Identificado] == 0) return SendClientMessage(playerid, COLOR_ROJO, "* Debes estar identificado para usar este comando");
if(Informacion[playerid][Admin] <3) return SendClientMessage(playerid, COLOR_ROJO, "** Tu no eres administrador");
{
if(sscanf(params, "dd", params[0], params[1])) return SendClientMessage(playerid, -1, "Use: /darmundo [id] [mundo]");
if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ROJO,"* ID no encontrada"); // Aquн no te iba a funcionar, ya que a params[0] no le dabas un valor.
SetPlayerVirtualWorld(params[0], params[1]);
new str[150];
format(str, sizeof(str), "** Administrador %s (%d) a puesto tu mundo virtual en %d", Nume(playerid), playerid, params[1]);
SendClientMessage(params[0], COLOR_CELESTE, str);
}
SendCommandToAdmins(playerid, "/darmundo");
return 1;
}
Revisa el cуdigo, realmente no es necesario crear variables.
Respuesta: Cual es el error en este comando? -
Jeree10 - 28.07.2015
sigue igual no cambia el mundo
Re: Cual es el error en este comando? -
Axxe - 28.07.2015
Ahora intenta con el mio 
.
PHP код:
CMD:darmundo(playerid, params[])
{
if(Informacion[playerid][Identificado] == 0)
return SendClientMessage(playerid,COLOR_ROJO,"* Debes estar identificado para usar este comando");
if(Informacion[playerid][Admin] < 1)
return SendClientMessage(playerid,COLOR_ROJO,"** Tu no eres administrador");
new
targetid = INVALID_PLAYER_ID, world;
if (sscanf(params, "ui", targetid, world))
return SendClientMessage(playerid, -1, "Use: /darmundo [id] [mundo]");
if (IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID)
{
new string[86]; // No desperdicies espacio.
SetPlayerVirtualWorld(targetid, world);
format(string, sizeof(string), "** Administrador %s (%d) a puesto tu mundo virtual en %d", Nume(playerid), playerid, world);
SendClientMessage(targetid, -1, string);
}
else SendClientMessage(playerid, -1, "El jugador no estб conectado.");
return true;
}
Respuesta: Cual es el error en este comando? -
Jeree10 - 28.07.2015
Muy amable todos pero nose porque ninguna cambia el vw
Respuesta: Cual es el error en este comando? -
Treyfus - 28.07.2015
Pero lo has probado con un tercero, me imagino. Porque si te auto cambias el mundo virtual, no notaras el cambio, a menos que estйs rodeado de objetos que por defecto tengan el virtual world en 0 y que desaparecerбn al cambiarte el VW.
Si no es asн, entonces prueba verificando si toma bien los parбmetros:
PHP код:
CMD:darmundo(playerid, params[])
{
if(Informacion[playerid][Identificado] == 0) return SendClientMessage(playerid,COLOR_ROJO,"* Debes estar identificado para usar este comando");
if(Informacion[playerid][Admin] <3) return SendClientMessage(playerid,COLOR_ROJO,"** Tu no eres administrador");
{
new id, mundo;
if(sscanf(params, "ud", id, mundo)) return SendClientMessage(playerid, -1, "Use: /darmundo [id] [mundo]");
if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ROJO,"* ID no encontrada");
SetPlayerVirtualWorld(id, mundo);
new str[150];
format(str,sizeof(str),"** Administrador %s (%d) a puesto tu mundo virtual en %d",Nume(playerid),playerid,mundo);
SendClientMessage(id,COLOR_CELESTE,str);
format(str, sizeof(str), "ID: %d - Virtual World: %d", id, mundo); // Esto te mostrarб las variables que has utilizado en el comando... fнjate si estбn tal cual la marcas al comando.
SendClientMessage(playerid, -1, str);
}
SendCommandToAdmins(playerid,"/darmundo");
return 1;
}
A simple vista, no hallo ningъn error posible...