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
SetPlayerSpecialAction(id,SPECIAL_ACTION_USEJETPACK);
format(string, sizeof(string),"Le diste a %s un jetpack!", id);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string2 ,sizeof(string2),"%s te dio un jetpack!", id);
SendClientMessage(id, COLOR_GREEN, string2);
}
return 1;
}
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; }
[21:51:49] sscanf warning: Format specifier does not match parameter count.
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; }
Код:
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; } |
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.
new nombre[MAX_PLAYER_NAME];
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; }
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];
new nombre2[MAX_PLAYER_NAME];
GetPlayerName(playerid, nombre2, sizeof(nombre2));
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!",nombre2);
SendClientMessage(id, COLOR_GREEN, string2);
}
return 1;
}
Ahн va "nombre" no "id" Esa es la razуn por la cual el nombre no es mostrado.
PHP код:
|
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.