C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 219: local variable "X" shadows a variable at a preceding level C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 219: local variable "Y" shadows a variable at a preceding level C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 219: local variable "Z" shadows a variable at a preceding level C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(814) : error 035: argument type mismatch (argument 2) C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(815) : warning 213: tag mismatch C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(816) : warning 213: tag mismatch C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(817) : warning 213: tag mismatch C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 203: symbol is never used: "Z" C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 203: symbol is never used: "Y" C:\Users\hp\Desktop\Mi servidor\gamemodes\gm.pwn(813) : warning 203: symbol is never used: "X" Pawn compiler 3.10.2 Copyright © 1997-2006, ITB CompuPhase 1 Error.
new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); InfoGPS[playerid][pGPSCoordsX][id] = X; InfoGPS[playerid][pGPSCoordsY][id] = Y; InfoGPS[playerid][pGPSCoordsZ][id] = Z;
new Float:posgpsX, Float:posgpsY, Float:posgpsZ;
GetPlayerPos(playerid, posgpsX, posgpsY, posgpsZ);
InfoGPS[playerid][pGPSCoordsX][id] = posgpsX;
InfoGPS[playerid][pGPSCoordsY][id] = posgpsY;
InfoGPS[playerid][pGPSCoordsZ][id] = posgpsZ;
GetPlayerPos ( playerid, InfoGPS[playerid][pGPSCoordsX][id], InfoGPS[playerid][pGPSCoordsY][id], InfoGPS[playerid][pGPSCoordsZ][id] );
Код:
GetPlayerPos ( playerid, InfoGPS[playerid][pGPSCoordsX][id], InfoGPS[playerid][pGPSCoordsY][id], InfoGPS[playerid][pGPSCoordsZ][id] ); |
Tu error es bastante sencillo amigo.
Lo que pasa es que esa variable X, Y, Z, ya las tienes creadas como globales y las estas volviendo a crear en ese cуdigo, cuando crees una variable global dale un nombre que la identifique mejor. La soluciуn para esto es la siguiente PHP код:
|
#define GEPEESES (12345)
enum GPSID
{
Float: pGPSCoordsX[10],
Float: pGPSCoordsY[10],
Float: pGPSCoordsZ[10],
pGPSName0[36],
pGPSName1[36],
pGPSName2[36],
pGPSName3[36],
pGPSName4[36],
pGPSName5[36],
pGPSName6[36],
pGPSName7[36],
pGPSName8[36],
pGPSName9[36]
}
new InfoGPS[MAX_PLAYERS][GPSID];
CMD:ayudagps(playerid, params[])
{
SendClientMessage(playerid, -1, "SISTEMA DE GPS POR USUARIO- Comandos: /editarmigps - /migps");
}
CMD:editarmigps(playerid, params[])
{
new Opcion[20], id, Extra[30];
if(sscanf(params, "s[20]ds[30]", Opcion, id, Extra)) return SendClientMessage(playerid, -1, "USO: /editarmigps [Opcion(Borrar-Crear-Nombre)][Slot][Nombre(Solo en uso de Opcion *Nombre*, default: 0)]");
if(id < 0 || id > 9) return SendClientMessage(playerid, -1, "{FFFF00}[ERROR]:{FFFFFF} Slot maximo: 9, slot minimo: 0");
if(strcmp(Opcion, "borrar", true) == 0)
{
InfoGPS[playerid][pGPSCoordsX][id] = 0.0;
InfoGPS[playerid][pGPSCoordsY][id] = 0.0;
InfoGPS[playerid][pGPSCoordsZ][id] = 0.0;
new _PSstring[128];
format(_PSstring, sizeof(_PSstring), "Has borrado el slot #%d de tu GPS.", id);
SendClientMessage(playerid, -1, _PSstring);
}
if(strcmp(Opcion, "crear", true) == 0)
{
new Float:posgpsX, Float:posgpsY, Float:posgpsZ;
GetPlayerPos(playerid, posgpsX, posgpsY, posgpsZ);
InfoGPS[playerid][pGPSCoordsX][id] = posgpsX;
InfoGPS[playerid][pGPSCoordsY][id] = posgpsY;
InfoGPS[playerid][pGPSCoordsZ][id] = posgpsZ;
switch(id)
{
case 0: format(InfoGPS[playerid][pGPSName0], 36, "Punto guardado.");
case 1: format(InfoGPS[playerid][pGPSName1], 36, "Punto guardado.");
case 2: format(InfoGPS[playerid][pGPSName2], 36, "Punto guardado.");
case 3: format(InfoGPS[playerid][pGPSName3], 36, "Punto guardado.");
case 4: format(InfoGPS[playerid][pGPSName4], 36, "Punto guardado.");
case 5: format(InfoGPS[playerid][pGPSName5], 36, "Punto guardado.");
case 6: format(InfoGPS[playerid][pGPSName6], 36, "Punto guardado.");
case 7: format(InfoGPS[playerid][pGPSName7], 36, "Punto guardado.");
case 8: format(InfoGPS[playerid][pGPSName8], 36, "Punto guardado.");
case 9: format(InfoGPS[playerid][pGPSName9], 36, "Punto guardado.");
}
new _PSstring[128];
format(_PSstring, sizeof(_PSstring), "Has creado el slot #%d(%s)de tu GPS.", id, Extra);
SendClientMessage(playerid, -1, _PSstring);
}
if(strcmp(Opcion, "nombre", true) == 0)
{
switch(id)
{
case 0: format(InfoGPS[playerid][pGPSName0], 36, "%s", Extra);
case 1: format(InfoGPS[playerid][pGPSName1], 36, "%s", Extra);
case 2: format(InfoGPS[playerid][pGPSName2], 36, "%s", Extra);
case 3: format(InfoGPS[playerid][pGPSName3], 36, "%s", Extra);
case 4: format(InfoGPS[playerid][pGPSName4], 36, "%s", Extra);
case 5: format(InfoGPS[playerid][pGPSName5], 36, "%s", Extra);
case 6: format(InfoGPS[playerid][pGPSName6], 36, "%s", Extra);
case 7: format(InfoGPS[playerid][pGPSName7], 36, "%s", Extra);
case 8: format(InfoGPS[playerid][pGPSName8], 36, "%s", Extra);
case 9: format(InfoGPS[playerid][pGPSName9], 36, "%s", Extra);
}
new _PSstring[128];
format(_PSstring, sizeof(_PSstring), "Has cambiado el nombre del slot #%d de tu GPS a *%s*.", id, Extra);
SendClientMessage(playerid, -1, _PSstring);
}
return 1;
}
CMD:migps(playerid, params[])
{
new dialog[36*10], string[128];
new nombre[300], Nombre2[36];
for(new i = 0; i < 10; i++)
{
switch(i)
{
case 0: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName0]);
case 1: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName1]);
case 2: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName2]);
case 3: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName3]);
case 4: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName4]);
case 5: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName5]);
case 6: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName6]);
case 7: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName7]);
case 8: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName8]);
case 9: format(Nombre2, 36, "%s", InfoGPS[playerid][pGPSName9]);
}
if(InfoGPS[playerid][pGPSCoordsX][i] == 0.0 && InfoGPS[playerid][pGPSCoordsY][i] == 0.0 && InfoGPS[playerid][pGPSCoordsZ][i] == 0.0)
{
format(string, sizeof(string), "\n{FFFFFF}%d| Slot sin uso", i);
strcat(dialog, string);
}
else
{
format(string, sizeof(string), "\n{FFFFFF}%d| %s [a %0.2f mts.]", i, Nombre2, GetPlayerDistanceFromPoint(playerid, InfoGPS[playerid][pGPSCoordsX][i], InfoGPS[playerid][pGPSCoordsY][i], InfoGPS[playerid][pGPSCoordsZ][i]));
strcat(dialog, string);
}
}
format(nombre, sizeof(nombre), "GPS");
ShowPlayerDialog(playerid, GEPEESES, DIALOG_STYLE_LIST, nombre, dialog, "Sacar", "Salir");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == GEPEESES)
{
if(!response)
{
return 1;
}
new i = listitem;
if(i >= 0 && i <= 9)
{
if(InfoGPS[playerid][pGPSCoordsX][i] == 0.0 && InfoGPS[playerid][pGPSCoordsY][i] == 0.0 && InfoGPS[playerid][pGPSCoordsZ][i] == 0.0) return SendClientMessage(playerid, -1, "Este slot no esta creado");
new Float:Flotantes[3];
Flotantes[0] = InfoGPS[playerid][pGPSCoordsX][i];
Flotantes[1] = InfoGPS[playerid][pGPSCoordsY][i];
Flotantes[2] = InfoGPS[playerid][pGPSCoordsZ][i];
SetPlayerCheckpoint(playerid, Flotantes[0], Flotantes[1], Flotantes[2], 5.0);
SendClientMessage(playerid, -1, "Has seleccionado un punto de tu GPS. Coordenadas marcadas en el mapa.");
}
}
return 1;
}
mira todo esto es lo que tengo
PHP код:
|
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
return 1;
}