Advertisement
losnato

[Gamemode] YSI

May 9th, 2013
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.54 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define  PP_YSI
  4. #define  MODE_NAME y_users
  5.  
  6. #include <YSI\y_users>
  7. #include <YSI\y_uvar>
  8.  
  9. #define     Register    1
  10. #define     Login       2
  11.  
  12. enum E_DATA
  13. {
  14.     plr_lvl,
  15.     plr_exp
  16. }
  17.  
  18. uvar player_data[MAX_PLAYERS][E_DATA];
  19.  
  20. main ( ) { }
  21.  
  22. public OnGameModeInit ( )
  23. {
  24.     Langs_AddLanguage ( "PT", "Português" );
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerConnect ( playerid )
  29. {
  30.     if ( !Player_IsRegistered ( playerid ) )
  31.         return ShowPlayerDialog ( playerid, Register, DIALOG_STYLE_PASSWORD, "Registro", \
  32.             "Digite uma senha para criar uma nova conta", \
  33.             "Registrar", "Sair" );
  34.  
  35.     else
  36.         return ShowPlayerDialog ( playerid, Login, DIALOG_STYLE_PASSWORD, "Login", \
  37.             "Digite sua senha para logar.", \
  38.             "Logar", "Sair" );
  39. }
  40.  
  41. public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext[] )
  42. {
  43.     switch ( dialogid )
  44.     {
  45.         case Register:
  46.         {
  47.             if ( !response )
  48.                 return 1;
  49.  
  50.             Player_TryRegister ( playerid, inputtext );
  51.  
  52.             return 1;
  53.         }
  54.         case Login:
  55.         {
  56.             if ( !response )
  57.                 return 1;
  58.  
  59.             Player_TryLogin ( playerid, inputtext );
  60.  
  61.             return 1;
  62.         }
  63.     }
  64.     return 1;
  65. }
  66.  
  67. public OnPlayerDeath ( playerid, killerid, reason )
  68. {
  69.     SendClientMessage ( killerid, -1, "Você ganhou 1xp por matar 1 jogador" );
  70.     player_data [ killerid ] [ plr_exp ] ++;
  71.  
  72.     if ( player_data [ killerid ] [ plr_exp ] == 5 )
  73.     {
  74.         player_data [ killerid ] [ plr_lvl ]++;
  75.         player_data [ killerid ] [ plr_exp ] = 0;
  76.  
  77.         SendClientMessage ( killerid, -1, "Parabéns, você evoluiu 1 level." );
  78.  
  79.         return 1;
  80.     }
  81.    
  82.     return 1;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement