daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest May 16th, 2018 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public OnPlayerStateChange(playerid, newstate, oldstate)
  2. {
  3.     new string[256];
  4.     if(newstate == PLAYER_STATE_ONFOOT)
  5.     {
  6.         if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
  7.         {
  8.             PlayerInKart[playerid] = 0;
  9.             KartingPlayers --;
  10.         }
  11.         if(TransportDuty[playerid] > 0)
  12.         {
  13.             if(TransportDuty[playerid] == 1)
  14.             {
  15.                 TaxiDrivers -= 1;
  16.             }
  17.             else if(TransportDuty[playerid] == 2)
  18.             {
  19.                 BusDrivers -= 1;
  20.             }
  21.             TransportDuty[playerid] = 0;
  22.             format(string, sizeof(string), "* Du bist nun aus dem Dienst und hast verdient $%d.", TransportMoney[playerid]);
  23.             SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  24.             GivePlayerMoney(playerid, TransportMoney[playerid]);
  25.             ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
  26.         }
  27.         if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
  28.         {
  29.             if(IsPlayerConnected(TransportDriver[playerid]))
  30.             {
  31.                 TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  32.                 TransportTime[TransportDriver[playerid]] = 0;
  33.                 TransportCost[TransportDriver[playerid]] = 0;
  34.                 format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
  35.                 GameTextForPlayer(playerid, string, 5000, 1);
  36.                 format(string, sizeof(string), "~w~Passagier verlässt das Taxi~n~~g~Lohn $%d",TransportCost[playerid]);
  37.                 GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
  38.                 GivePlayerMoney(playerid, -TransportCost[playerid]);
  39.                 TransportCost[playerid] = 0;
  40.                 TransportTime[playerid] = 0;
  41.                 TransportDriver[playerid] = 999;
  42.             }
  43.         }
  44.         TelePos[playerid][0] = 0.0;
  45.         TelePos[playerid][1] = 0.0;
  46.     }
  47.     if(newstate == PLAYER_STATE_WASTED)
  48.     {
  49.         if(WantedLevel[playerid] >= 1)
  50.         {
  51.             new price = WantedLevel[playerid] * 4000;
  52.             new count;
  53.             for(new i = 0; i < MAX_PLAYERS; i++)
  54.             {
  55.                 if(IsPlayerConnected(i))
  56.                 {
  57.                     if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
  58.                     {
  59.                         count = 1;
  60.                         format(string, sizeof(string), "~w~Running Suspect~r~Killed~n~Bonus~g~$%d", price);
  61.                         GameTextForPlayer(i, string, 5000, 1);
  62.                         ConsumingMoney[i] = 1;
  63.                         GivePlayerMoney(i, price / 2);
  64.                         PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
  65.                     }
  66.                 }
  67.             }
  68.             if(count == 1)
  69.             {
  70.                 GivePlayerMoney(playerid, - price);
  71.                 PlayerInfo[playerid][pWantedDeaths] += 1;
  72.                 PlayerInfo[playerid][pJailed] = 1;
  73.                 PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
  74.                 format(string, sizeof(string), "* Du wurde eingebuchtet für %d Sekunden undverlierst $%d weil du geflüchtet bist und der Cop dich erschossen hat.", PlayerInfo[playerid][pJailTime], price);
  75.                 SendClientMessage(playerid, COLOR_LIGHTRED, string);
  76.                 WantedPoints[playerid] = 0;
  77.                 WantedLevel[playerid] = 0;
  78.             }
  79.         }
  80.     }
  81.     if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
  82.     {// 38 / 49 / 56 = SS
  83.         new newcar = GetPlayerVehicleID(playerid);
  84.         new oldcar = gLastCar[playerid];
  85.         new housecar = PlayerInfo[playerid][pPhousekey]+1;
  86.         TelePos[playerid][0] = 0.0;
  87.         TelePos[playerid][1] = 0.0;
  88.         if(IsABoat(newcar))
  89.         {
  90.             if(PlayerInfo[playerid][pBoatLic] < 1)
  91.             {
  92.                 SendClientMessage(playerid, COLOR_GREY, " Du hast kein Bootschein");
  93.                 RemovePlayerFromVehicle(playerid);
  94.  
  95.             }
  96.         }
  97.         else if(IsAPlane(newcar))
  98.         {
  99.             if(PlayerInfo[playerid][pFlyLic] < 1)
  100.             {
  101.                 if(TakingLesson[playerid] == 1) { }
  102.                 else
  103.                 {
  104.                     SendClientMessage(playerid, COLOR_GREY, "Du hast noch keinen Flugschein!");
  105.                     SendClientMessage(playerid, COLOR_GREY, "Es wird dir nun die Position der Flugscheinprüfung auf der Karte angezeigt.");
  106.                     RemovePlayerFromVehicle(playerid);
  107.                     SetPlayerCheckpoint(playerid, 1961.6835,-2186.3857,13.5469, 5.0);
  108.                 }
  109.             }
  110.         }
  111.         else if(IsAHeli(newcar))
  112.         {
  113.             if(PlayerInfo[playerid][pHeliLic] < 1)
  114.             {
  115.                 if(TakingLesson[playerid] == 1) { }
  116.                 else
  117.                 {
  118.                     SendClientMessage(playerid, COLOR_GREY, "Du hast noch keinen Flugschein!");
  119.                     SendClientMessage(playerid, COLOR_GREY, "Es wird dir nun die Position der Flugscheinprüfung auf der Karte angezeigt.");
  120.                     RemovePlayerFromVehicle(playerid);
  121.                     SetPlayerCheckpoint(playerid, 1961.6835,-2186.3857,13.5469, 5.0);
  122.                 }
  123.             }
  124.         }
  125.         else if(IsABike(newcar))
  126.         {
  127.             if(PlayerInfo[playerid][pBikeLic] < 1)
  128.             {
  129.                 if(TakingLesson[playerid] == 1) { }
  130.                 else
  131.                 {
  132.                     SendClientMessage(playerid, COLOR_GREY, "Du hast noch keinen Motorrad Schein!");
  133.                     SendClientMessage(playerid, COLOR_GREY, "Es wird dir nun die Position der Motorradscheinprüfung auf der Karte angezeigt.");
  134.                     RemovePlayerFromVehicle(playerid);
  135.                     SetPlayerCheckpoint(playerid, 1357.9976,-1626.3860,13.5908, 5.0);
  136.                 }
  137.             }
  138.         }
  139.         else if(IsAlkw(newcar))
  140.         {
  141.             if(PlayerInfo[playerid][plkwLic] == 0)
  142.             {
  143.                 if(TakingLesson[playerid] == 0)
  144.                 {
  145.                     SendClientMessage(playerid, COLOR_GREY, "Du hast noch kein LKW Schein!");
  146.                     SendClientMessage(playerid, COLOR_GREY, "Es wird dir nun die Position der LKW Scheinprüfung auf der Karte angezeigt.");
  147.                     RemovePlayerFromVehicle(playerid);
  148.                     SetPlayerCheckpoint(playerid, 70.9459,-243.8313,1.5781, 5.0);
  149.                 }
  150.             }
  151.         }
  152.         else if(IsANoLicVehicle(newcar)) { }
  153.         else
  154.         {
  155.             if(PlayerInfo[playerid][pCarLic] < 1)
  156.             {
  157.                 if(PlayerDrunk[playerid] >= 5)
  158.                 {
  159.                     WantedPoints[playerid] += 1;
  160.                     SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
  161.                 }
  162.                 if((TakingLesson[playerid] == 1))
  163.                 {
  164.                 }
  165.                 else {
  166.                 SendClientMessage(playerid, COLOR_GREY, "Du hast noch keinen Führerschein!");
  167.                 SendClientMessage(playerid, COLOR_GREY, "Du kannst diesen an der /navi Fahrschule machen.");
  168.                 RemovePlayerFromVehicle(playerid);
  169.                 return 1; }
  170.             }
  171.             else if(PlayerDrunk[playerid] >= 5)
  172.             {
  173.                 WantedPoints[playerid] += 1;
  174.                 SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
  175.             }
  176.             else if(PlayerDrunk[playerid] >= 5)
  177.             {
  178.                 WantedPoints[playerid] += 1;
  179.                 SetPlayerCriminal(playerid,255, "Betrunken am Steuer...");
  180.             }
  181.         }
  182.         if(IsACopCar(newcar))
  183.         {
  184.             if(IsACop(playerid)) { }
  185.             else { RemovePlayerFromVehicle(playerid); }
  186.         }
  187.         else if(IsAnAmbulance(newcar))
  188.         {
  189.             if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
  190.             else { RemovePlayerFromVehicle(playerid); }
  191.         }
  192.         if(IsATruck(newcar))
  193.         {
  194.             format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
  195.             SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  196.             SendClientMessage(playerid, COLOR_WHITE, "Soldat: Hier gibt es Materalien");
  197.             SendClientMessage(playerid, COLOR_WHITE, "Soldat: Gebe folgendes ein /load /buyprods /sellprods");
  198.         }
  199.         if(PlayerKarting[playerid] != 0)
  200.         {
  201.             new kart = GetPlayerVehicleID(playerid);
  202.             if(kart==110||kart==111||kart==112||kart==113||kart==114||kart==115)
  203.             {
  204.                 PlayerInKart[playerid] = 1;
  205.                 KartingPlayers ++;
  206.             }
  207.         }
  208.         if(newcar == 39 || newcar == 40)
  209.         {
  210.             if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//national guard
  211.             {
  212.                 if(PlayerInfo[playerid][pRank] < 3)
  213.                 {
  214.                     SendClientMessage(playerid,COLOR_GREY,"   Du brauchst Rang 3  !");
  215.                     RemovePlayerFromVehicle(playerid);
  216.                 }
  217.             }
  218.             else
  219.             {
  220.                 RemovePlayerFromVehicle(playerid);
  221.             }
  222.         }
  223.         if(newcar == 55 || newcar == 59)
  224.         {
  225.             if(PlayerInfo[playerid][pMember] != 4)
  226.             {
  227.                 SendClientMessage(playerid,COLOR_GREY,"   Du bist kein Feuerwehr/Sanitäter !");
  228.                 RemovePlayerFromVehicle(playerid);
  229.             }
  230.         }
  231.         if(newcar == 64 || newcar == 65)
  232.         {
  233.             if(PlayerInfo[playerid][pJob] != 14)
  234.             {
  235.                 SendClientMessage(playerid,COLOR_GREY,"   Du bist kein Busfahrer !");
  236.                 RemovePlayerFromVehicle(playerid);
  237.             }
  238.         }
  239.         if(newcar == 69 || newcar == 70 || newcar == 71 || newcar == 99 || newcar == 100 || newcar == 101)
  240.         {
  241.             if(TakingLesson[playerid] == 1) { }
  242.             else if(!IsAnInstructor(playerid))
  243.             {
  244.                 SendClientMessage(playerid,COLOR_GREY,"   Du bist kein Fahrlehrer !");
  245.                 RemovePlayerFromVehicle(playerid);
  246.             }
  247.         }
  248.         if(newcar == 82 || newcar == 84 || newcar == 85 || newcar == 94)
  249.         {
  250.             if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
  251.             else
  252.             {
  253.                 SendClientMessage(playerid,COLOR_GREY,"   Du bist kein Taxifahrer !");
  254.                 RemovePlayerFromVehicle(playerid);
  255.             }
  256.         }
  257.         if(newcar == 95)
  258.         {
  259.             if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
  260.             {
  261.                 if(PlayerInfo[playerid][pRank] < 3)
  262.                 {
  263.                     SendClientMessage(playerid, COLOR_GREY, "   Dein Rang ist zu klein !");
  264.                     RemovePlayerFromVehicle(playerid);
  265.                 }
  266.             }
  267.             else
  268.             {
  269.                 SendClientMessage(playerid, COLOR_GREY, "   Du arbeitest nicht bei der Firma !");
  270.                 RemovePlayerFromVehicle(playerid);
  271.             }
  272.         }
  273.         if(newcar == 96 || newcar == 97 || newcar == 98)
  274.         {
  275.             if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9){ }
  276.             else
  277.             {
  278.                 SendClientMessage(playerid, COLOR_GREY, "  Du bist kein Reporter !");
  279.                 RemovePlayerFromVehicle(playerid);
  280.             }
  281.             if(PlayerInfo[playerid][pNewsSkill] < 200 && newcar == 96)
  282.             {
  283.                 SendClientMessage(playerid, COLOR_GREY, "   Dein Reporter skill ist noch zu klein !");
  284.                 RemovePlayerFromVehicle(playerid);
  285.             }
  286.         }
  287.         if(newcar==110||newcar==111||newcar==112||newcar==113||newcar==114||newcar==115)
  288.         {
  289.             if(PlayerKarting[playerid] != 1)
  290.             {
  291.                 RemovePlayerFromVehicle(playerid);
  292.             }
  293.         }
  294.         if(newcar >= 72 && newcar <= 74)
  295.         {
  296.             if (HireCar[playerid] != newcar)
  297.             {
  298.                 format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[0][sbEntranceCost]);
  299.                 TogglePlayerControllable(playerid, 0);
  300.                 GameTextForPlayer(playerid, string, 5000, 3);
  301.             }
  302.         }
  303.         if(newcar >= 75 && newcar <= 77)
  304.         {
  305.             if (HireCar[playerid] != newcar)
  306.             {
  307.                 format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[1][sbEntranceCost]);
  308.                 TogglePlayerControllable(playerid, 0);
  309.                 GameTextForPlayer(playerid, string, 5000, 3);
  310.             }
  311.         }
  312.         if(oldcar != 301)
  313.         {
  314.             if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
  315.             {
  316.                 if(gLastDriver[oldcar] == playerid && oldcar != newcar)
  317.                 {
  318.                     gLastDriver[oldcar] = 300;
  319.                     gCarLock[oldcar] = 0;
  320.                     UnLockCar(oldcar);
  321.                 }
  322.             }
  323.         }
  324.         gLastCar[playerid] = newcar;
  325.         gLastDriver[newcar] = playerid;
  326.     }
  327.     if(newstate == PLAYER_STATE_SPAWNED)
  328.     {
  329.         new Float: lwx, Float:lwy, Float:lwz;
  330.         GetPlayerPos(playerid, lwx, lwy, lwz);
  331.         if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
  332.         {
  333.             SetPlayerSpawn(playerid);
  334.         }
  335.         if(WantedPoints[playerid] > 0)
  336.         {
  337.             new dstring[128];
  338.             new wanted = WantedPoints[playerid];
  339.             new diecash = 0;
  340.             while(WantedPoints[playerid] > 0)
  341.             {
  342.                 diecash += 500;
  343.                 WantedPoints[playerid] --;
  344.             }
  345.             format(dstring, sizeof(dstring), "You lost $%d for dieing with %d Wanted Points.", diecash, wanted);
  346.             SendClientMessage(playerid, COLOR_YELLOW, dstring);
  347.             GivePlayerMoney(playerid, - diecash);
  348.             PlayerInfo[playerid][pWantedDeaths] += 1;
  349.         }
  350.         if(PlayerOnMission[playerid] > 0)
  351.         {
  352.             GameTextForPlayer(playerid, "~r~Mission failed", 5000, 3);
  353.             PlayerOnMission[playerid] = 0;
  354.             PlayerInfo[playerid][pMissionNr] = 0;
  355.         }
  356.         WantedPoints[playerid] = 0;
  357.         WantedLevel[playerid] = 0;
  358.         if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
  359.         else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); }
  360.         MedicBill[playerid] = 1;
  361.         TelePos[playerid][0] = 0.0;
  362.         TelePos[playerid][1] = 0.0;
  363.         gPlayerSpawned[playerid] = 1;
  364.         SafeTime[playerid] = 60;
  365.     }
  366.     return 1;
  367. }
RAW Paste Data
Top