SA-MP Forums Archive
[Ajuda] Sistema Vip - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Sistema Vip (/showthread.php?tid=534278)



Sistema Vip - MrBrownstone - 29.08.2014

Queria ajuda em um sistema VIP que vence automaticamente, para 1 mes, 3 meses e dps 6 meses, e um comando tipo /darvip (ID) (Quantia de Meses) (Numero do Vip 1 a 3)
Tenho um sistema vip mas ele e meio bugado e o tempo tambem й bugado, ele fica pra sempre, tem como alguem me arrumar um codigo do sistema vip todo aн ? ai onde for pra colocar as minhas variaveis ou essas coisas sу colocar: [----].
Agradeзo muito a quem conseguir me ajudar.
Obrigado.


Re: Sistema Vip - Spectral - 29.08.2014

Aqui um sistema vip assim:
https://sampforum.blast.hk/showthread.php?tid=404067

Ele й em 3 processadores de comando e 2 sistemas de salvamento. Vocк escolhe qual atende аs suas necessidades.
Ele nгo tem comandos para vip, falta adicionar. Й sу "a бrvore" falta "enfeitar" para o natal.


Re: Sistema Vip - MrBrownstone - 29.08.2014

Aproveitando o momento, ja que e um FS, alguns FS no meu GM tem hora que carregam e tem hora que nao, geralmente apos um gmx eles nao carregam novamente, e meu Gmx estб correto creio eu, vc sabe oque pode ser ??


Re: Sistema Vip - MrBrownstone - 29.08.2014

isso aqui if(strcmp(cmd, "/darhelper", true) == 0), seria bCmd, iCmd ou zCmd ?


Re: Sistema Vip - Rodney Francalim - 29.08.2014

Fiz agorinha sem testar, entгo pode conter bugs.

Tenha isso como base e bons estudos!

pawn Код:
public OnPlayerConnect( playerid )
{
    // Receba o dado do tempo VIP do jogador e atribua a variбvel PlayerInfo[ playerid ][ pTempoVip ]
    if( gettime() >= PlayerInfo[ playerid ][ pTempoVip ])
    {
        SendClientMessage( playerid, -1, "Seu VIP acabou." );
        PlayerInfo[ playerid ][ pVip ] = 0;
    }
}

CMD:darvip( playerid, params[])
{
    new
        str[ 128 ],
        nome[ MAX_PLAYER_NAME ]
    ;

    if( sscanf( params, "udd", params[ 0 ], params[ 1 ], params[ 2 ])) return SendClientMessage( playerid, -1, "USE: /darvip [ID] [MESES] [NIVEL VIP]" );
    if( params[ 0 ] == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Este jogador nгo estб online." );
    if( params[ 1 ] <= 0 ) return SendClientMessage( playerid, -1, "Quantidade de meses invбlida." );
    if( params[ 2 ] < 0 || params[ 2 ] > 3 ) return SendClientMessage( playerid, -1, "Nнvel VIP inexistente." );
    if( params[ 2 ] == 0 )
    {
        PlayerInfo[ params[ 0 ]][ pVip ] = 0;
        PlayerInfo[ params[ 0 ]][ pTempoVip ] = 0;
        GetPlayerName( playerid, nome, sizeof( nome ));
        format( str, sizeof( str ), "O administrador %s retirou seu VIP.", nome );
        SendClientMessage( params[ 0 ], -1, str );
        GetPlayerName( params[ 0 ], nome, sizeof( nome ));
        format( str, sizeof( str ), "Vocк removeu o VIP do jogador %s.", nome );
        SendClientMessage( playerid, -1, str );
        return 1;
    }
    PlayerInfo[ params[ 0 ]][ pTempoVip ] = gettime() + ( 60 * 60 * 24 * 30 * params[ 1 ]);
    PlayerInfo[ params[ 0 ]][ pVip ] = params[ 2 ];
    GetPlayerName( playerid, nome, sizeof( nome ));
    format( str, sizeof( str ), "O administrador %s te deu VIP nнvel %d durante %d mes(es).", nome, params[ 2 ], params[ 1 ]);
    SendClientMessage( params[ 0 ], -1, str );
    GetPlayerName( params[ 0 ], nome, sizeof( nome ));
    format( str, sizeof( str ), "Vocк deu VIP nнvel %d durante %d mes(es) para o jogador %s.", params[ 2 ], params[ 1 ], nome );
    SendClientMessage( params[ 0 ], -1, str );
    return 1;
}
@EDIT:

Use ZCMD e SSCANF2.




Re: Sistema Vip - MrBrownstone - 29.08.2014

Quote:
Originally Posted by Rodney Francalim
Посмотреть сообщение
Fiz agorinha sem testar, entгo pode conter bugs.

Tenha isso como base e bons estudos!

pawn Код:
public OnPlayerConnect( playerid )
{
    // Receba o dado do tempo VIP do jogador e atribua a variбvel PlayerInfo[ playerid ][ pTempoVip ]
    if( gettime() >= PlayerInfo[ playerid ][ pTempoVip ])
    {
        SendClientMessage( playerid, -1, "Seu VIP acabou." );
        PlayerInfo[ playerid ][ pVip ] = 0;
    }
}

CMD:darvip( playerid, params[])
{
    new
        str[ 128 ],
        nome[ MAX_PLAYER_NAME ]
    ;

    if( sscanf( params, "udd", params[ 0 ], params[ 1 ], params[ 2 ])) return SendClientMessage( playerid, -1, "USE: /darvip [ID] [MESES] [NIVEL VIP]" );
    if( params[ 0 ] == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Este jogador nгo estб online." );
    if( params[ 1 ] <= 0 ) return SendClientMessage( playerid, -1, "Quantidade de meses invбlida." );
    if( params[ 2 ] < 0 || params[ 2 ] > 3 ) return SendClientMessage( playerid, -1, "Nнvel VIP inexistente." );
    if( params[ 2 ] == 0 )
    {
        PlayerInfo[ params[ 0 ]][ pVip ] = 0;
        PlayerInfo[ params[ 0 ]][ pTempoVip ] = 0;
        GetPlayerName( playerid, nome, sizeof( nome ));
        format( str, sizeof( str ), "O administrador %s retirou seu VIP.", nome );
        SendClientMessage( params[ 0 ], -1, str );
        GetPlayerName( params[ 0 ], nome, sizeof( nome ));
        format( str, sizeof( str ), "Vocк removeu o VIP do jogador %s.", nome );
        SendClientMessage( playerid, -1, str );
        return 1;
    }
    PlayerInfo[ params[ 0 ]][ pTempoVip ] = gettime() + ( 60 * 60 * 24 * 30 * params[ 1 ]);
    PlayerInfo[ params[ 0 ]][ pVip ] = params[ 2 ];
    GetPlayerName( playerid, nome, sizeof( nome ));
    format( str, sizeof( str ), "O administrador %s te deu VIP nнvel %d durante %d mes(es).", nome, params[ 2 ], params[ 1 ]);
    SendClientMessage( params[ 0 ], -1, str );
    GetPlayerName( params[ 0 ], nome, sizeof( nome ));
    format( str, sizeof( str ), "Vocк deu VIP nнvel %d durante %d mes(es) para o jogador %s.", params[ 2 ], params[ 1 ], nome );
    SendClientMessage( params[ 0 ], -1, str );
    return 1;
}
@EDIT:

Use ZCMD e SSCANF2.

Valeu ae cara, mas e a parada pra tirar o vip automatico quando acabar ? =P


Re: Sistema Vip - Rodney Francalim - 29.08.2014

Tem ali no OnPlayerConnect.


Re: Sistema Vip - MrBrownstone - 29.08.2014

Cara, sei que sou noob nisso kkk mas pq deu esses erros ?

C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8496) : error 017: undefined symbol "pTempoVip"
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8499) : error 017: undefined symbol "pVip"
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8503) : error 017: undefined symbol "darvip"
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8510) : error 017: undefined symbol "sscanf"
C:\Users\User\Desktop\GM\GM1\gamemodesCreating.pwn (8510) : warning 215: expression has no effect
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8510) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8510) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\GM\GM1\gamemodes\Creating.pw n(8510) : fatal error 107: too many error messages on one line

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


7 Errors.


Re: Sistema Vip - Rodney Francalim - 29.08.2014

Cara, na moral.

Para de editar gamemode e constrуi o teu do zero.

Falei pra tu usar isso que eu fiz como base, mas sу fez copiar e colar.


Re: Sistema Vip - MrBrownstone - 29.08.2014

Cara, eu nao to editando esse pra colocar no ar nгo, sу quero aprender, so q comeзar do 0 й muito dificil, vc pd me ajudar do jeito q estou pedindo ? pf...