Advertisement
Guest User

[FS] Sistema Skin em Dialog

a guest
Apr 21st, 2012
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.84 KB | None | 0 0
  1. /*
  2.  
  3. Sistema Skin em Dialog [ID]
  4. Created By > @Riichard [OwnPlaay]
  5. [SDS] Drift > 69.162.102.12:7773
  6.  
  7. */
  8. #include <a_samp>
  9. #define DIALOG_SKIN 700 // ID JA USADA? SO MODIFICAR!
  10.  
  11. // Cores Que Vou Usar
  12. #define Azul 0x1E90FFAA
  13. #define Vermelho 0xFF0000AA
  14. #define Sucesso 0x00FF00AA
  15. // Variavel
  16. new string[128];
  17. new badSkins[22];
  18.  
  19. // == Inicio == //
  20. #if defined FILTERSCRIPT
  21.  
  22. public OnFilterScriptInit()
  23. {
  24.     print("\n--------------------------------------");
  25.     print("  >    Sistema Skin em Dialog [ID]  <");
  26.     print("--------------------------------------\n");
  27.     return 1;
  28. }
  29.  
  30. #endif
  31.  
  32. // Public -
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35. if(!strcmp(cmdtext, "/skin", true))
  36. {
  37. new Nick[MAX_PLAYER_NAME];
  38. GetPlayerName(playerid, Nick, MAX_PLAYER_NAME);
  39. format(string, sizeof(string), "Player : %s(ID:%d)  Está alterando sua Skin! {00BFFF}/Skin", Nick,playerid);
  40. SendClientMessageToAll(Azul, string);
  41. ShowPlayerDialog(playerid,DIALOG_SKIN,DIALOG_STYLE_INPUT,"Seleção Skin:","Digite a ID Da Skin Abaixo:","Selecionar","Fechar");
  42. }
  43. return 0;
  44. }
  45.  
  46. // Public -
  47. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  48. {
  49. if(dialogid == DIALOG_SKIN)
  50. {
  51. if(!response)
  52.  
  53. return SendClientMessage(playerid, Vermelho, ": Troca de Skin Cancelada.");
  54.  
  55. if(!strval(inputtext))
  56.  
  57. return SendClientMessage(playerid, Vermelho, ": Troca de Skin Cancelada.");
  58.  
  59. if(strval(inputtext) < 0 || strval(inputtext) > 299)
  60.  
  61. return SendClientMessage(playerid, Vermelho, "- Skin Inválida!");
  62.  
  63. for(new i = 0; i < sizeof(badSkins); i++)
  64.  
  65. if(strval(inputtext) == badSkins[i])
  66.  
  67. return SendClientMessage(playerid, Vermelho, "- Skin Inválida!");
  68.  
  69. format(string, sizeof(string), "> Skin Alterada! ID : %d", strval(inputtext));
  70.  
  71. SendClientMessage(playerid, Sucesso, string);
  72.  
  73. SetPlayerSkin(playerid,strval(inputtext));
  74. }
  75. return 0;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement