Advertisement
Guest User

Untitled

a guest
May 4th, 2010
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.20 KB | None | 0 0
  1. forward OtherTimer();
  2.  
  3. public OtherTimer()
  4. {
  5.     new Float:maxspeed = 175.0;
  6.     new plname[MAX_PLAYER_NAME];
  7.     new string[256];
  8.     new Float:oldposx, Float:oldposy, Float:oldposz;
  9.     for(new i = 0; i < MAX_PLAYERS; i++)
  10.     {
  11.         if(IsPlayerConnected(i))
  12.         {
  13.             if (GetPlayerState(i) == 1) CheckForWalkingTeleport(i); // IF THE PLAYER IS IN A TELEPORT ZONE, TELEPORT THEM
  14.             new vehicleid = GetPlayerVehicleID(i);
  15.             if(SafeTime[i] > 0)
  16.             {
  17.                 SafeTime[i]--;
  18.             }
  19.             if(SafeTime[i] == 1)
  20.             {
  21.                 if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
  22.                 {
  23.                     new loginname[64];
  24.                     new loginstring[128];
  25.                     GetPlayerName(i,loginname,64);
  26.                     format(loginstring,sizeof(loginstring),"Sveicinats GameWorld Role Play %s\nSis vards ir registrets.\nTev ir 30 sekundes laika lai, ielogotos:",loginname);
  27.                     ShowPlayerDialog(i,12346,DIALOG_STYLE_INPUT,"Ielogosanas panelis",loginstring,"Ielogoties","Iziet");
  28.                 }
  29.             }
  30.             if(GetPlayerState(i) == 2)
  31.             {
  32.                 GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
  33.                 if(TelePos[i][5] > 550.0)
  34.                 {
  35.                     TelePos[i][0] = 0.0;
  36.                     TelePos[i][1] = 0.0;
  37.                 }
  38.                 if(TelePos[i][0] != 0.0)
  39.                 {
  40.                     new Float:xdist = TelePos[i][3]-TelePos[i][0];
  41.                     new Float:ydist = TelePos[i][4]-TelePos[i][1];
  42.                     new Float:sqxdist = xdist*xdist;
  43.                     new Float:sqydist = ydist*ydist;
  44.                     new Float:distance = (sqxdist+sqydist)/31;
  45.                     if ((BusrouteEast[i][0] == 0 && BusrouteWest[i][0] == 0))
  46.                     {
  47.                         if(gSpeedo[i] == 2)
  48.                         {
  49.                             if(distance <10)
  50.                             {
  51.                                 format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h :   ~w~%.0f",distance);
  52.                             }
  53.                             if(distance > 10 && distance < 100)
  54.                             {
  55.                                 format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h :  ~w~%.0f",distance);
  56.                             }
  57.                             if(distance > 100)
  58.                             {
  59.                                 format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h : ~w~%.0f",distance);
  60.                             }
  61.                             GameTextForPlayer(i, string, 2000, 5);
  62.                         }
  63.                         if(distance > maxspeed && PlayerInfo[i][pAdmin] < 1)
  64.                         {
  65.                             new tmpcar = GetPlayerVehicleID(i);
  66.                             if(!IsAPlane(tmpcar))
  67.                             {
  68.                                 GetPlayerName(i, plname, sizeof(plname));
  69.                                 format(string, 256, "AdmWarning: [%d]%s %.0f km/h",i,plname,distance);
  70.                                 ABroadCast(COLOR_YELLOW,string,1);
  71.                             }
  72.                         }
  73.                     }
  74.                 }
  75.                 if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
  76.                 {
  77.                     TelePos[i][0] = TelePos[i][3];
  78.                     TelePos[i][1] = TelePos[i][4];
  79.                 }
  80.             }
  81.             if(PlayerInfo[i][pLocal] != 255 && PlayerInfo[i][pInt] != 0)
  82.             {
  83.                 GetPlayerPos(i, oldposx, oldposy, oldposz);
  84.                 if(oldposz != 0.0)
  85.                 {
  86.                     if(oldposz < 600.0)
  87.                     {
  88.                         /*if(house > 10000)
  89.                         {
  90.                             new tmpcar = GetPlayerVehicleID(i);
  91.                             if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003)
  92.                             {
  93.                                 if (GetPlayerState(i) == 2)
  94.                                 {
  95.                                     SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
  96.                                     SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]);
  97.                                 }
  98.                                 else
  99.                                 {
  100.                                     SetPlayerPos(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
  101.                                 }
  102.                                 new oldcash = gSpentCash[i];
  103.                                 new Total = GetPlayerMoney(i) - oldcash;
  104.                                 printf("Total %d = GetPlayerMoney(playerid) %d - oldcash %d",Total,GetPlayerMoney(i),oldcash);
  105.                                 new name[MAX_PLAYER_NAME];
  106.                                 GetPlayerName(i, name, sizeof(name));
  107.                                 format(string,128,"<< %s has left the homemodshop with $%d >>",name,Total);
  108.                                 PayLog(string);
  109.                                 gSpentCash[i] = 0;
  110.                                 TelePos[i][0] = 0.0;
  111.                                 TelePos[i][1] = 0.0;
  112.                                 PlayerInfo[i][pLocal] = 255;
  113.                                 SetPlayerInterior(i,0);
  114.                                 PlayerInfo[i][pInt] = 0;
  115.                                 Spectate[i] = 255;
  116.                             }
  117.                         }*/
  118.                     }
  119.                 }
  120.             }
  121.             if(CellTime[i] > 0)
  122.             {
  123.                 if (CellTime[i] == cchargetime)
  124.                 {
  125.                     CellTime[i] = 1;
  126.                     if(Mobile[Mobile[i]] == i)
  127.                     {
  128.                         CallCost[i] = CallCost[i]+callcost;
  129.                     }
  130.                 }
  131.                 CellTime[i] = CellTime[i] +1;
  132.                 if (Mobile[Mobile[i]] == 255 && CellTime[i] == 5)
  133.                 {
  134.                     if(IsPlayerConnected(Mobile[i]))
  135.                     {
  136.                         new called[MAX_PLAYER_NAME];
  137.                         GetPlayerName(Mobile[i], called, sizeof(called));
  138.                         format(string, sizeof(string), "* %s'am zvana telefons *dzin* *dzin* *dzin*.", called);
  139.                         RingTone[Mobile[i]] = 10;
  140.                         ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  141.                     }
  142.                 }
  143.             }
  144.             if(CellTime[i] == 0 && CallCost[i] > 0)
  145.             {
  146.                 format(string, sizeof(string), "~w~Zvans maksa~n~~r~$%d",CallCost[i]);
  147.                 SafeGivePlayerMoney(i, -CallCost[i]);
  148.                 GameTextForPlayer(i, string, 5000, 1);
  149.                 CallCost[i] = 0;
  150.             }
  151.             if(TransportTime[i] > 0)
  152.             {//Taxi driver and passenger only
  153.                 if(TransportTime[i] >= 16)
  154.                 {
  155.                     TransportTime[i] = 1;
  156.                     if(TransportDriver[i] < 999)
  157.                     {
  158.                         if(IsPlayerConnected(TransportDriver[i]))
  159.                         {
  160.                             TransportCost[i] += TransportValue[TransportDriver[i]];
  161.                             TransportCost[TransportDriver[i]] = TransportCost[i];
  162.                         }
  163.                     }
  164.                 }
  165.                 TransportTime[i] += 1;
  166.                 format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
  167.                 GameTextForPlayer(i, string, 15000, 6);
  168.             }
  169.             if (BusrouteEast[i][0] != 0 || BusrouteWest[i][0] != 0)
  170.             {
  171.                 if (!IsPlayerInAnyVehicle(i) || !IsABus(GetPlayerVehicleID(i)))
  172.                 if (vehicleid != 0)
  173.                 {
  174.                     if (!IsABus(vehicleid))
  175.                     {
  176.                         if (BusrouteEast[i][0] != 0) BusrouteEnd(i, BusrouteEast[i][1]);
  177.                         else if (BusrouteWest[i][0] != 0) BusrouteEnd(i, BusrouteWest[i][1]);
  178.                     }
  179.                 }
  180.                 else
  181.                 {
  182.                     if (BusrouteEast[i][0] != 0) BusrouteEnd(i, BusrouteEast[i][1]);
  183.                     else if (BusrouteWest[i][0] != 0) BusrouteEnd(i, BusrouteWest[i][1]);
  184.                 }
  185.             }
  186.             if (IsABus(vehicleid) && GetPlayerState(i) == 2 && PlayerInfo[i][pJob] != 14)
  187.             {
  188.                 SetVehicleToRespawn(vehicleid);
  189.             }
  190.         }
  191.     }
  192.     return 1;
  193. }
  194.  
  195. othtimer = SetTimer("OtherTimer", 1000, true); // this was under GameModeInit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement