Problema con SendClientMessage
#7

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
intenta asi:
pawn Код:
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;
}
EDIT:




Si, las variables se inicializan por defecto con el valor 0.
Me tira 4 errores
Код:
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
Quote:
Originally Posted by DreamOnIt
Посмотреть сообщение
pawn Код:
else
                {
                    SendClientMessage(playerid, -1, "No hay Recompensas.");
                }
Entonces para que queres esto si no queres que se mande no? :/

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
Para que haga una funciуn y no se quede en blanco.

Quote:
Originally Posted by dis77urbio
Посмотреть сообщение
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;
}
Tambiйn me tira 4 errores
(Parecidos a los de arriba)
Reply


Messages In This Thread
Problema con SendClientMessage - by godoy32 - 31.10.2011, 23:47
Re: Problema con SendClientMessage - by DreamOnIt - 01.11.2011, 00:11
Respuesta: Problema con SendClientMessage - by TheChaoz - 01.11.2011, 00:14
Respuesta: Problema con SendClientMessage - by iKeN - 01.11.2011, 00:18
Re: Problema con SendClientMessage - by dis77urbio - 01.11.2011, 00:26
Respuesta: Problema con SendClientMessage - by TheChaoz - 01.11.2011, 00:52
Respuesta: Problema con SendClientMessage - by godoy32 - 01.11.2011, 01:52
Respuesta: Problema con SendClientMessage - by Ari3l - 01.11.2011, 02:17
Re: Problema con SendClientMessage - by [O.z]Caroline - 01.11.2011, 02:19
Respuesta: Problema con SendClientMessage - by TheChaoz - 01.11.2011, 02:25

Forum Jump:


Users browsing this thread: 1 Guest(s)