iPaulinho

[FilterScript] Change Skin [Dialog]

May 21st, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.76 KB | None | 0 0
  1. #include <a_samp>
  2. #define DIALOG_SKIN 2428 // ID JA USADA? SO MODIFICAR!
  3.  
  4.  
  5. #define Azul 0x1E90FFAA
  6. #define Vermelho 0xFF0000AA
  7. #define Sucesso 0x00FF00AA
  8.  
  9. new string[128];
  10. new badSkins[22];
  11.  
  12. #if defined FILTERSCRIPT
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.         print("\n--------------------------------------");
  17.         print("  >    Sistema Skin em Dialog [ID]  <");
  18.         print("--------------------------------------\n");
  19.         return 1;
  20. }
  21.  
  22. #endif
  23.  
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27. if(!strcmp(cmdtext, "/skin", true))
  28. {
  29. new Nick[MAX_PLAYER_NAME];
  30. GetPlayerName(playerid, Nick, MAX_PLAYER_NAME);
  31. format(string, sizeof(string), "[Change Skin] %s(ID:%d)  Está alterando sua skin! {00BFFF}/Skin", Nick,playerid);
  32. SendClientMessageToAll(Azul, string);
  33. ShowPlayerDialog(playerid,DIALOG_SKIN,DIALOG_STYLE_INPUT,"Seleção Skin","Digite o ID da skin desejada abaixo:","Selecionar","Fechar");
  34. }
  35. return 0;
  36. }
  37.  
  38.  
  39. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  40. {
  41. if(dialogid == DIALOG_SKIN)
  42. {
  43. if(!response)
  44.  
  45. return SendClientMessage(playerid, Vermelho, "[INFO] Troca de skin cancelada.");
  46.  
  47. if(!strval(inputtext))
  48.  
  49. return SendClientMessage(playerid, Vermelho, "[INFO] Troca de skin cancelada.");
  50.  
  51. if(strval(inputtext) < 0 || strval(inputtext) > 299)
  52.  
  53. return SendClientMessage(playerid, Vermelho, "[INFO] Skin Invalida.");
  54.  
  55. for(new i = 0; i < sizeof(badSkins); i++)
  56.  
  57. if(strval(inputtext) == badSkins[i])
  58.  
  59. return SendClientMessage(playerid, Vermelho, "[INFO] Skin Invalida.");
  60.  
  61. format(string, sizeof(string), "[INFO] A sua skin foi alterada para à ID: %d", strval(inputtext));
  62.  
  63. SendClientMessage(playerid, Sucesso, string);
  64.  
  65. SetPlayerSkin(playerid,strval(inputtext));
  66. }
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment