ulbi1990

uFun

May 20th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. #define DEFAULTTIME 500 //Hier definieren was der Standard wert ist für die Timer (MS)
  6. #define MINTIME 50 //Hier definieren was das mindest erlaubte ist an Zeit (MS) für die Timer
  7.  
  8. enum TrollEnum
  9. {
  10.     RainbowActive,
  11.     RainbowActiveTime,
  12.     RainbowActiveTimer,
  13.     RainbowAllActive,
  14.     RainbowAllActiveStarter
  15. }
  16.  
  17. new tInfo[MAX_PLAYERS][TrollEnum];
  18.  
  19. public OnFilterScriptInit()
  20. {
  21.     print(" ");
  22.     print("\t\t|=============================|");
  23.     print("\t\t|uFun - Have fun with trolling|");
  24.     print("\t\t|     scripted by ulbi1990    |");
  25.     print("\t\t|=============================|");
  26.     print(" ");
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     print("uFun wurde erfollgreich vom Server entladen!");
  33.     return 1;
  34. }
  35.  
  36. public OnPlayerConnect(playerid)
  37. {
  38.     tInfo[playerid][RainbowActiveTime]=DEFAULTTIME;
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerDisconnect(playerid,reason)
  43. {
  44.     if(tInfo[playerid][RainbowAllActiveStarter]==playerid)
  45.     {
  46.         KillTimer(tInfo[playerid][RainbowActiveTimer]);
  47.         for(new i;i<GetMaxPlayers();i++)
  48.         {
  49.             tInfo[i][RainbowAllActive]=0;
  50.         }
  51.         SendClientMessageToAll(-1,"Rainbowall wurde gestoppt!");
  52.     }
  53.     return 1;
  54. }
  55.  
  56. CMD:rainbowtime(playerid,params[])
  57. {
  58.     new time,str[128];
  59.     if(sscanf(params,"d",time)) return SendClientMessage(playerid,-1,"[NUTZUNG]: /rainbowtime [Zeit in Ms]");
  60.     {
  61.         if(time<50) return SendClientMessage(playerid,-1,"Nicht weniger als 50 MS!");
  62.         {
  63.             tInfo[playerid][RainbowActiveTime]=time;
  64.             format(str,sizeof(str),"Du hast den Timer auf '%d' ms gestellt!",tInfo[playerid][RainbowActiveTime]);
  65.             SendClientMessage(playerid,-1,str);
  66.         }
  67.     }
  68.     return 1;
  69. }
  70.  
  71. CMD:rainbow(playerid,params[])
  72. {
  73.     if(GetPlayerVehicleSeat(playerid)==0)
  74.     {
  75.         if(tInfo[playerid][RainbowAllActive]==0)
  76.         {
  77.             if(tInfo[playerid][RainbowActive]==0)
  78.             {
  79.                 tInfo[playerid][RainbowActiveTimer]=SetTimerEx("RainbowTimer",tInfo[playerid][RainbowActiveTime],1,"i",playerid);
  80.                 SendClientMessage(playerid,-1,"Zum stoppen von Rainbow erneute eingabe des Befehles!");
  81.                 tInfo[playerid][RainbowActive]=1;
  82.             }
  83.             else if(tInfo[playerid][RainbowActive]==1)
  84.             {
  85.                 KillTimer(tInfo[playerid][RainbowActiveTimer]);
  86.                 SendClientMessage(playerid,-1,"Rainbow wurde gestoppt!");
  87.                 tInfo[playerid][RainbowActive]=0;
  88.             }
  89.         }
  90.     }
  91.     return 1;
  92. }
  93.  
  94. CMD:rainbowall(playerid,params[])
  95. {
  96.     if(tInfo[playerid][RainbowAllActive]==0)
  97.     {
  98.         tInfo[playerid][RainbowActiveTimer]=SetTimer("RainbowTimer",tInfo[playerid][RainbowActiveTime],1);
  99.         tInfo[playerid][RainbowAllActiveStarter]=playerid;
  100.         SendClientMessageToAll(-1,"Rainbowall wurde gestartet!");
  101.         for(new i;i<GetMaxPlayers();i++)
  102.         {
  103.             tInfo[i][RainbowAllActive]=1;
  104.         }
  105.     }
  106.     else
  107.     {
  108.         if(tInfo[playerid][RainbowAllActiveStarter]==playerid)
  109.         {
  110.             KillTimer(tInfo[playerid][RainbowActiveTimer]);
  111.             for(new i;i<GetMaxPlayers();i++)
  112.             {
  113.                 tInfo[i][RainbowAllActive]=0;
  114.             }
  115.             SendClientMessageToAll(-1,"Rainbowall wurde gestoppt!");
  116.         }
  117.     }
  118.     return 1;
  119. }
  120.  
  121. forward RainbowTimer(playerid);
  122. public RainbowTimer(playerid)
  123. {
  124.     if(tInfo[playerid][RainbowAllActive]==0)
  125.     {
  126.         ChangeVehicleColor(GetPlayerVehicleID(playerid),random(9999),random(9999));
  127.     }
  128.     else if(tInfo[playerid][RainbowAllActive]==1)
  129.     {
  130.         for(new i;i<MAX_VEHICLES;i++)
  131.         {
  132.             ChangeVehicleColor(i,random(9999),random(9999));
  133.         }
  134.     }
  135.     return 1;
  136. }
Advertisement
Add Comment
Please, Sign In to add comment