Advertisement
Juras35

[SA-MP] Random text (includ)

Apr 18th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.15 KB | None | 0 0
  1. // PlayerName stock, RandomEx stock, SCMTAF is my SendClientMessageToAll + Format
  2.  
  3. new
  4.     Random_text[9] = "none";
  5.    
  6. // OnGameModeInit: SetTimer("Show_random_text", 60000*6, true);
  7.  
  8. forward Show_random_text();
  9. public Show_random_text(){
  10.     format(Random_text, 9, "%c%c%c%c%c%c%c%c",
  11.     Get_random_letter(), Get_random_letter(), Get_random_letter(), Get_random_letter(), Get_random_letter(), Get_random_letter(),
  12.     Get_random_letter(), Get_random_letter());
  13.     SCMTAF(-1, "Napiš jako první do chatu [ %s ] a získej náhodnou částku.", Random_text);
  14.     return true;
  15. }
  16.  
  17. stock randomText_OnPlayerText(playerid, text[]){ // OnPlayerText: randomText_OnPlayerText(playerid, text);
  18.     if(strcmp(Random_text, "none", true)){
  19.         if(!strcmp(text, Random_text, true)){
  20.             new
  21.                 amount = RandomEx(3000,5000);
  22.                
  23.             SCMTAF(-1, "Hráč %s(%d) napsal jako první do chatu [ %s ] a získal $%d.", PlayerName(playerid), playerid, Random_text, amount);
  24.             format(Random_text, 9, "none");
  25.             GivePlayerMoney(playerid, amount);
  26.         }
  27.     }
  28.     return true;
  29. }
  30.  
  31. stock Get_random_letter(){
  32.     return 65 + random(52);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement