Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #include a_samp.inc
  3. #include colorpicker.inc
  4.  
  5. public OnPlayerSpawn(playerid)
  6. {
  7. ShowPlayerColorPicker(playerid, 3, false, false); //without "cancel" and "alpha"
  8. return 1;
  9. }
  10.  
  11. public OnPlayerCommandText(playerid, cmdtext[])
  12. {
  13. if(!strcmp(cmdtext, "/colorname", true))
  14. {
  15. ShowPlayerColorPicker(playerid, 1, true);
  16. }
  17. if(!strcmp(cmdtext, "/colormsg", true))
  18. {
  19. ShowPlayerColorPicker(playerid, 2); //without "alpha"
  20. }
  21. return 1;
  22. }
  23.  
  24. public OnColorPickerResponse(playerid, pickerid, color, response)
  25. {
  26. if(pickerid == 1)
  27. {
  28. if(!response) return 1;
  29.  
  30. SetPlayerColor(playerid, color);
  31. }
  32. if(pickerid == 2)
  33. {
  34. if(!response) return 1;
  35.  
  36. SendClientMessage(playerid, color, "COLOR {00AAFF}<< You choose this color");
  37. }
  38. if(pickerid == 3)
  39. {
  40. SetPlayerColor(playerid, color);
  41. }
  42. return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement