SA-MP Forums Archive
Comando incompleto / erroneo - 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: Comando incompleto / erroneo (/showthread.php?tid=411668)



Comando incompleto / erroneo - benjas09 - 29.01.2013

Funciona a la perfeccion, pero no me dice a quien le di el jetpack.
Y el usuario tampoco le dice quien se lo dio.
PHP код:
CMD:jetpack(playeridparams[])
{
    new 
idstring[128], string2[128];
    if(!
IsPlayerAdmin(playerid)) return 0;
    {
        if(
sscanf(params,"ii",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
            
SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        
format(stringsizeof(string),"Le diste a %s un jetpack!"id);
        
SendClientMessage(playeridCOLOR_GREENstring);
        
format(string2 ,sizeof(string2),"%s te dio un jetpack!"id);
        
SendClientMessage(idCOLOR_GREENstring2);
    }
    return 
1;

Gracias, buenas noche.


Respuesta: Comando incompleto / erroneo - OneBlaack - 29.01.2013

Код:
CMD:jetpack(playerid, params[])
{
    new id, string[128], string2[128];
    if(!IsPlayerAdmin(playerid)) return 0;
    {
        if(sscanf(params,"ii",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
        new nombre[MAX_PLAYER_NAME];
         GetPlayerName(id, nombre, sizeof(nombre)); 
            SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        format(string, sizeof(string),"Le diste a %s un jetpack!", nombre);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string2 ,sizeof(string2),"%s te dio un jetpack!", id);
        SendClientMessage(id, COLOR_GREEN, string2);
    }
    return 1;
}
Prueba


Respuesta: Comando incompleto / erroneo - benjas09 - 29.01.2013

Video usandolo.
[ame]http://www.youtube.com/watch?v=-BGZs5Tt2gE[/ame]

Pero hay un problema, cuando uso /jetpack ID
Salta esto en la consola.
Код:
[21:51:49] sscanf warning: Format specifier does not match parameter count.



Respuesta: Comando incompleto / erroneo - OneBlaack - 29.01.2013

Код:
CMD:jetpack(playerid, params[])
{
    new id, string[128], string2[128];
    if(!IsPlayerAdmin(playerid)) return 0;
    {
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
        new nombre[MAX_PLAYER_NAME];
         GetPlayerName(id, nombre, sizeof(nombre)); 
            SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        format(string, sizeof(string),"Le diste a %s un jetpack!", nombre);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string2 ,sizeof(string2),"%s te dio un jetpack!", id);
        SendClientMessage(id, COLOR_GREEN, string2);
    }
    return 1;
}



Respuesta: Comando incompleto / erroneo - benjas09 - 29.01.2013

Quote:
Originally Posted by OneBlaack
Посмотреть сообщение
Код:
CMD:jetpack(playerid, params[])
{
    new id, string[128], string2[128];
    if(!IsPlayerAdmin(playerid)) return 0;
    {
        if(sscanf(params,"ii",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
        new nombre[MAX_PLAYER_NAME];
         GetPlayerName(id, nombre, sizeof(nombre)); 
            SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        format(string, sizeof(string),"Le diste a %s un jetpack!", nombre);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string2 ,sizeof(string2),"%s te dio un jetpack!", id);
        SendClientMessage(id, COLOR_GREEN, string2);
    }
    return 1;
}
Prueba
Код:
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 003: declaration of a local variable must appear in a compound block
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 017: undefined symbol "nombre"
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : warning 215: expression has no effect
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Linea 368
PHP код:
new nombre[MAX_PLAYER_NAME]; 



Respuesta: Comando incompleto / erroneo - OneBlaack - 29.01.2013

Код:
CMD:jetpack(playerid, params[])
{
    new id, string[128], string2[128], nombre[MAX_PLAYER_NAME];
    if(!IsPlayerAdmin(playerid)) return 0;
    {
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
         GetPlayerName(id, nombre, sizeof(nombre));
            SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        format(string, sizeof(string),"Le diste a %s un jetpack!", nombre);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string2 ,sizeof(string2),"%s te dio un jetpack!", id);
        SendClientMessage(id, COLOR_GREEN, string2);
    }
    return 1;
}



Re: Comando incompleto / erroneo - Daniel-92 - 29.01.2013

borrб el else


Respuesta: Comando incompleto / erroneo - benjas09 - 29.01.2013

[ame]http://www.youtube.com/watch?v=Ocy293ffsTI[/ame]

No dice quien se lo dio.

Gracias pa.


Re: Comando incompleto / erroneo - ThePhenix - 30.01.2013

Ahн va "nombre" no "id" Esa es la razуn por la cual el nombre no es mostrado.

PHP код:
CMD:jetpack(playeridparams[])
{
    new 
idstring[128], string2[128];
    if(!
IsPlayerAdmin(playerid)) return 0;
    {
        if(
sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
        new 
nombre[MAX_PLAYER_NAME];
        new 
nombre2[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnombre2sizeof(nombre2));
         
GetPlayerName(idnombresizeof(nombre)); 
            
SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        
format(stringsizeof(string),"Le diste a %s un jetpack!"nombre);
        
SendClientMessage(playeridCOLOR_GREENstring);
        
format(string2 ,sizeof(string2),"%s te dio un jetpack!",nombre2);
        
SendClientMessage(idCOLOR_GREENstring2);
    }
    return 
1;




Respuesta: Re: Comando incompleto / erroneo - benjas09 - 30.01.2013

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Ahн va "nombre" no "id" Esa es la razуn por la cual el nombre no es mostrado.

PHP код:
CMD:jetpack(playeridparams[])
{
    new 
idstring[128], string2[128];
    if(!
IsPlayerAdmin(playerid)) return 0;
    {
        if(
sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: /jetpack [playerID]");
        else
        new 
nombre[MAX_PLAYER_NAME];
        new 
nombre2[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnombre2sizeof(nombre2));
         
GetPlayerName(idnombresizeof(nombre)); 
            
SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
        
format(stringsizeof(string),"Le diste a %s un jetpack!"nombre);
        
SendClientMessage(playeridCOLOR_GREENstring);
        
format(string2 ,sizeof(string2),"%s te dio un jetpack!",nombre2);
        
SendClientMessage(idCOLOR_GREENstring2);
    }
    return 
1;

Код:
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 003: declaration of a local variable must appear in a compound block
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 017: undefined symbol "nombre"
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : warning 215: expression has no effect
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\carspawn.pwn(368) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.