No hay Recompensas. No hay Recompensas. No hay Recompensas. Godoy32 - Total [$20000] Godoy - Total [$10000] No hay Recompensas. No hay Recompensas. No hay Recompensas. No hay Recompensas. No hay Recompensas.
Godoy32 - Total [$20000] Godoy - Total [$10000]
dcmd_recompensas (playerid, params[])
{
#pragma unused params
new stingEX[256], i, count;
for (i = 0; i < GetMaxPlayers(); i++)
{
if (IsPlayerConnected(i))
{
if (Cantidad[i] > 0) count ++;
{
if (count >= 1)
{
format( stingEX, sizeof(stingEX),"- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
SendClientMessage(playerid,-1,stingEX);
}
else
{
SendClientMessage(playerid, -1, "No hay Recompensas.");
}
}
}
}
return 1;
}
else
{
SendClientMessage(playerid, -1, "No hay Recompensas.");
}
dcmd_recompensas (playerid, params[])
{
#pragma unused params
new stingEX[X], count;
for(new i; i<GetMaxPlayers(); i++){
if(IsPlayerConnected(i) && Cantidad[i]){
count++;
format(stringEX, sizeof(stringEX), "- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
SendClientMessage(playerid,-1,stingEX);
}
}
if(!count)return SendClientMessage(playerid, -1, "No hay recompenzas");
return 1;
}
intenta asi:
pawn Код:
|
dcmd_recompensas( playerid, params[ ] )
{
#pragma unused params
new bString[ MAX_CLIENT_MSG ], pName[ MAX_PLAYER_NAME ], counter; bString = "* ";
SendClientMessage( playerid, COLOR_GREEN, "Recompensas:" );
for(new i=0; i < MAX_PLAYERS; i++)
{
if ( pData[ i ][ P_BOUNTY ] ) //AQUI PON TU VARIABLE DE LAS RECOMPENSAS
{
GetPlayerName( i, pName, MAX_PLAYER_NAME );
if ( counter > 2 )
{
SendClientMessage( playerid, COLOR_YELLOW, bString );
bString = "* ";
format( bString, sizeof( bString ), "%s%s(%d)($%d), ", bString, pName, i,pData[ i ][ P_BOUNTY ] );//PON TU VARIABLE DE LAS RECOMPENSAS
counter = 1;
}
else
{
format( bString, sizeof( bString ), "%s%s(%d)($%d), ", bString, pName, i, pData[ i ][ P_BOUNTY ] );// PON TU VARIABLE DE LAS RECOMPENSAS
counter++;
}
}
}
if ( strlen( bString[ 2 ] ) )
SendClientMessage( playerid, COLOR_YELLOW, bString );
return 1;
}
intenta asi:
pawn Код:
Si, las variables se inicializan por defecto con el valor 0. |
C:\Documents and Settings\Godoy\Mis documentos\GTA San Andreas User Files\SAMP\Server 6\gamemodes\server.pwn(594) : error 017: undefined symbol "X" C:\Documents and Settings\Godoy\Mis documentos\GTA San Andreas User Files\SAMP\Server 6\gamemodes\server.pwn(594) : error 029: invalid expression, assumed zero C:\Documents and Settings\Godoy\Mis documentos\GTA San Andreas User Files\SAMP\Server 6\gamemodes\server.pwn(594) : error 017: undefined symbol "count" C:\Documents and Settings\Godoy\Mis documentos\GTA San Andreas User Files\SAMP\Server 6\gamemodes\server.pwn(594) : fatal error 107: too many error messages on one line
pawn Код:
pd: en pawn las variables se inicializan implicitamente a cero? pregunto, porque si no es asi, inicializala, porque acumula valores basura y te puede llegar a dar cualquier cosa Saludos |
pawn Код:
|
dcmd_recompensas (playerid, params[])
{
#pragma unused params
new stingEX[256], count;
for(new i; i<GetMaxPlayers(); i++){
if(IsPlayerConnected(i) && Cantidad[i]){
count++;
format(stringEX, sizeof(stringEX), "- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
SendClientMessage(playerid,-1,stingEX);
}
}
if(!count)return SendClientMessage(playerid, -1, "No hay recompenzas");
return 1;
}
dcmd_recompensas (playerid, params[])
{
#pragma unused params
new stingEX[128], count;
for(new i; i<GetMaxPlayers(); i++){
if(IsPlayerConnected(i) && Cantidad[i]){
count++;
format(stringEX, sizeof(stringEX), "- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
SendClientMessage(playerid,-1,stingEX);
}
}
if(!count)return SendClientMessage(playerid, -1, "No hay recompenzas");
return 1;
}