Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define PP_YSI
- #define MODE_NAME y_users
- #include <YSI\y_users>
- #include <YSI\y_uvar>
- #define Register 1
- #define Login 2
- enum E_DATA
- {
- plr_lvl,
- plr_exp
- }
- uvar player_data[MAX_PLAYERS][E_DATA];
- main ( ) { }
- public OnGameModeInit ( )
- {
- Langs_AddLanguage ( "PT", "Português" );
- return 1;
- }
- public OnPlayerConnect ( playerid )
- {
- if ( !Player_IsRegistered ( playerid ) )
- return ShowPlayerDialog ( playerid, Register, DIALOG_STYLE_PASSWORD, "Registro", \
- "Digite uma senha para criar uma nova conta", \
- "Registrar", "Sair" );
- else
- return ShowPlayerDialog ( playerid, Login, DIALOG_STYLE_PASSWORD, "Login", \
- "Digite sua senha para logar.", \
- "Logar", "Sair" );
- }
- public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext[] )
- {
- switch ( dialogid )
- {
- case Register:
- {
- if ( !response )
- return 1;
- Player_TryRegister ( playerid, inputtext );
- return 1;
- }
- case Login:
- {
- if ( !response )
- return 1;
- Player_TryLogin ( playerid, inputtext );
- return 1;
- }
- }
- return 1;
- }
- public OnPlayerDeath ( playerid, killerid, reason )
- {
- SendClientMessage ( killerid, -1, "Você ganhou 1xp por matar 1 jogador" );
- player_data [ killerid ] [ plr_exp ] ++;
- if ( player_data [ killerid ] [ plr_exp ] == 5 )
- {
- player_data [ killerid ] [ plr_lvl ]++;
- player_data [ killerid ] [ plr_exp ] = 0;
- SendClientMessage ( killerid, -1, "Parabéns, você evoluiu 1 level." );
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement