Error en Pawno - 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: Error en Pawno (
/showthread.php?tid=416059)
Error en Pawno -
FelipeMancilla - 15.02.2013
Buen Dia, estube editando un GameMode, todo iva bien hasta hoy, que le di F5 para Compile, Y Me salio este error.
C:\Users\Daniel y Laura\Desktop\Alianza Virtual RP\Zenon City Role Play\gamemodes\AlianzaVirtualRP.pwn(49895) : error 030: compound statement not closed at the end of file (started at line 49854)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Soy nuevo en Pawno, Otra duda que tengo.. їQue es pasar las lineas del Script? Recuerden que soy Noob, porfavor no criticarme. Espero respuesta.
Respuesta: Error en Pawno -
CrossOv3r - 15.02.2013
En el pawno, al lado salen unas lineas correlativas
Muestra la linea 49854 hasta la 49895
AW: Error en Pawno -
FelipeMancilla - 15.02.2013
Quote:
Originally Posted by CrossOv3r
En el pawno, al lado salen unas lineas correlativas
Muestra la linea 49854 hasta la 49895
|
Eso si lo sabia, ok ya te paso el Code. Te lo doy hasta la 49894. Ya que no tiene 49895.
pawn Код:
foreach(Player, i){
if(Info[i][pAdminZC] >= 2){
if(Spectating[i] >= 1){
if(Spectate[i] < 553){
new targetid = Spectate[ i ];
if( !IsPlayerConnected( targetid ) ){
SendClientMessageEx( i, COLOR_WHITE, "El jugador que estabas specteando salio del servidor." );
GettingSpectated[Spectate[i]] = 999;
Spectating[i] = 0;
Spectate[i] = 999;
SetPVarInt(i, "SpecState", -1);
SetPVarInt(i, "SpecOff", 1 );
TogglePlayerSpectating( i, false );
SetCameraBehindPlayer(i);
}
}
if(Spectate[i] == 553){
TogglePlayerControllable(i, 1);
TogglePlayerSpectating(i, 0);
DeletePVar(i, "MedicBill");
SpawnPlayer( i );
Spectate[i] = 999;
Spectating[i] = 0;
}
if(Spectate[i] == 554){
TogglePlayerControllable(i, 1);
SetPlayerInterior(i,Unspec[i][sPint]);
Info[i][pInt] = Unspec[i][sPint];
SetPlayerPos(i, Unspec[i][Coords][0], Unspec[i][Coords][1], Unspec[i][Coords][2]);
Spectate[i] = 999;
}
if(Spectate[i] == 556){
SetPlayerToTeamColor(i);
Spectate[i] = 999;
}
if(Spectate[i] == 557){
Spectate[i] = 554;
}
}
}
}
Respuesta: Error en Pawno -
JustBored - 15.02.2013
Ahн te falta retornar a 1
y ese error es porque falta un "}"
AW: Error en Pawno -
FelipeMancilla - 15.02.2013
Quote:
Originally Posted by JustBored
Ahн te falta retornar a 1 y ese error es porque falta un "}"
|
Gracias amigo, el error era el "}" Ya me funciono, gracias.
Re: Respuesta: Error en Pawno -
Daniel-92 - 15.02.2013
Quote:
Originally Posted by JustBored
Ahн te falta retornar a 1 y ese error es porque falta un "}"
|
el return se usa cuando se necesita darle un valor a una funciуn o cuando se necesite finalizar la funcнon y este no es el caso.
Ejemplo.
pawn Код:
if(Funcion() == 10) {
print("Funcion tiene el valor de 10");
}
Funcion() {
return 10;
}
pawn Код:
printf("Hay %d jugadores conectados",ContarJugadores());
stock ContarJugadores() {
new jugadores;
for(new i=0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) {
jugadores++;
}
return jugadores;
}
Respuesta: Re: Respuesta: Error en Pawno -
pinpon - 15.02.2013
Quote:
Originally Posted by Daniel-92
el return se usa cuando se necesita darle un valor a una funciуn o cuando se necesite finalizar la funcнon y este no es el caso.
Ejemplo.
pawn Код:
if(Funcion() == 10) { print("Funcion tiene el valor de 10"); }
Funcion() { return 10; }
pawn Код:
printf("Hay %d jugadores conectados",ContarJugadores());
stock ContarJugadores() { new jugadores; for(new i=0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { jugadores++; } return jugadores; }
|
Seria:
Tu mismo lo dijiste,no tiene un valor en especial.Yo en el "LarAdmin" lo puse asн.
Re: Respuesta: Re: Respuesta: Error en Pawno -
Daniel-92 - 16.02.2013
Quote:
Originally Posted by pinpon
Seria:
Tu mismo lo dijiste,no tiene un valor en especial.Yo en el "LarAdmin" lo puse asн.
|
A como dije, se usa cuando se requiere retornar algo, si usas el return ahн estarias deteniendo el bucle por lo cъal generaria un bug y si no tiene un valor en especial simplemente no se pone.