Advertisement
Guest User

Nummernschild

a guest
Aug 23rd, 2010
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.65 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //#define ZUFALL // Wenn die Buchstaben für die Stadt zufällig sein sollen, und nicht LS, oder SF.
  4.  
  5. public OnPlayerConnect(playerid)
  6. {
  7.     new string[10]; string = CreateNummernSchild(playerid);
  8.     SendClientMessage(playerid, 0xffffffff, string);
  9.     return 1;
  10. }
  11.  
  12. new ABC[26][0] = {
  13.     {"A"}, {"B"}, {"C"}, {"D"}, {"E"}, {"F"}, {"G"}, {"H"}, {"I"}, {"J"}, {"K"}, {"L"}, {"M"},
  14.     {"N"}, {"O"}, {"P"}, {"Q"}, {"R"}, {"S"}, {"T"}, {"U"}, {"V"}, {"W"}, {"X"}, {"Y"}, {"Z"}
  15. };
  16.  
  17. CreateNummernSchild(playerid)
  18. {
  19.     new Float:xx, Float:yy, Float:zz;
  20.     GetPlayerPos(playerid, xx, yy, zz);
  21.  
  22.     new zufall = random(2);
  23.     new bla1 = random(26);
  24.     new bla2 = random(26);
  25.     new zahl1 = random(9)+1, zahl2 = random(9)+1, zahl3 = random(9)+1, zahl4 = random(9)+1;
  26.     new string[10], stadt[2], mitte[2], zahlen[4];
  27.     new zahl = random(4)+1;
  28.  
  29.     if((xx > -992.5172 && xx < 4000.0000) && (yy < 528.0000 && yy > -4000.0000))
  30.     {
  31.               format(stadt, sizeof(stadt), "LS");
  32.     }
  33.     if((xx > -4000.0000 && xx< -992.5172) && (yy < 4000.0000 && yy > -4000.0000))
  34.     {
  35.               format(stadt, sizeof(stadt), "SF");
  36.     }
  37.  
  38.     if(zufall) { format(mitte, sizeof(mitte), "%s%s", ABC[bla1], ABC[bla2]); }
  39.     else { format(mitte, sizeof(mitte), "%s", ABC[bla1]); }
  40.  
  41.     if(zahl == 1){format(zahlen, sizeof(zahlen), "%d", zahl1);}
  42.     else if(zahl == 2){format(zahlen, sizeof(zahlen), "%d%d", zahl1, zahl2);}
  43.     else if(zahl == 3){format(zahlen, sizeof(zahlen), "%d%d%d", zahl1, zahl2, zahl3);}
  44.     else if(zahl == 4){format(zahlen, sizeof(zahlen), "%d%d%d%d", zahl1, zahl2, zahl3, zahl4);}
  45.  
  46.     format(string, sizeof(string), "%s-%s-%s", stadt, mitte, zahlen); // Das ist der
  47.     return string;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement