Üzenetek megjelenítése

Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.


Üzenetek - jozsi0502

Oldalak: 1 ... 6 7 [8] 9 10
106
Beszélgetés / Számoljunk el 10.000-ig!
« Dátum: 2012. Augusztus 02. - 14:37:11 »
755

107
Segítségkérés / Jármû spawn kordináta át írása
« Dátum: 2012. Augusztus 02. - 11:41:42 »
/ This command checks if the player is inside a vehicle that he owns and if he\'s in range of the house where the vehicle is assigned to
COMMAND:park(playerid, params[])
{
// Setup local variables
new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
new engine,lights,alarm,doors,bonnet,boot,objective;
// Send the command to all admins so they can see it
SendAdminText(playerid, \"/park\", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player is inside a vehicle (he must be the driver)
if (GetPlayerVehicleSeat(playerid) == 0)
{
   // Get the vehicle-id
   vid = GetPlayerVehicleID(playerid);
   // Get the HouseID to which this vehicle belongs
   HouseID = AVehicleData[vid][belongsToHouse];
   // Check if the vehicle is owned (owner-check is not really required, as another player would get kicked out very fast)
   // AND it must belong to a house that the player owns
   if ((AVehicleData[vid][Owned] == true) && (HouseID != 0))
   {
      // Check if the vehicle is in range of the house-entrance (you cannot park a vehicle further away from your house than 150m)
      if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
      {
         // Get the player\'s position and angle
         GetVehiclePos(vid, x, y, z);
         GetVehicleZAngle(vid, rot);
         // Save those values for the vehicle
         AVehicleData[vid][spawnX] = x;
         AVehicleData[vid][spawnY] = y;
         AVehicleData[vid][spawnZ] = z;
         AVehicleData[vid][spawnRot] = rot;
         // Find the vehicle in the player\'s houses
         for (new i; i < MAX_HOUSESPERPLAYER; i++)
         {
            // Get the HouseID of the current house
             HouseID = APlayerData[playerid][Houses];
            // Loop through all carslots of this house to find the vehicle-id
            for (new CarSlot; CarSlot < 10; CarSlot++)
            {
               // Check if this carslot holds the same vehicle-id
                if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
                {
                       House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the same spot the player wants to park his vehicle
                       PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
                  // Turn on the engine
                  GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, lights, alarm, doors, bonnet, boot, objective);
                       break; // Stop the for-loop
               }
            }
         }
         // Let the player know he parked his vehicle
         SendClientMessage(playerid, 0x00FF00FF, \"Leparkoltál a kocsival\");
         // Save the player-file (and his houses)
         PlayerFile_Save(playerid);
      }
      else
      {
          format(Msg, 128, \"{FF0000}Ház közelében kell lenned hogy le tudj parkolni\", ParkRange);
          SendClientMessage(playerid, 0xFFFFFFFF, Msg);
      }
   }
   else
       SendClientMessage(playerid, 0xFF0000FF, \"Nem parkolhatsz le ezzel a jarmûvel,nem a tiéd\");
}
else
    SendClientMessage(playerid, 0xFF0000FF, \"Nincs mit leparkolni\");
}
else
    return 0;
// Let the server know that this was a valid command
return 1;
}

 
Tess

Dupla hozzászólás automatikusan összefûzve. ( 2012. Augusztus 02. - 19:25:17 )

// Buy a vehicle and assign it to the house
Dialog_BuyCar(playerid, response, listitem)
{
// Just close the dialog if the player clicked \"Cancel\"
if(!response) return 1;
// Setup local variables
new Counter, Msg[128], cComponents[14];
// Get the HouseID
new HouseID = APlayerData[playerid][CurrentHouse];
// Loop through the entire list of buyable vehicles
for (new i; i < sizeof(ABuyableVehicles); i++)
{
// Check if the vehicle in the list has the same class as requested
if (ABuyableVehicles[VehicleClass] == APlayerData[playerid][DialogBuyVClass])
{
    // Check if this is the vehicle that the player chose
    if (Counter == listitem)
   {
       // Check if the player has enough money to afford buying this vehicle
       if (APlayerData[playerid][PlayerMoney] >= (ABuyableVehicles[Price]))
       {
         // Add the vehicle to the house (this sets ownership and other data that\'s needed)
         // The vehicles are by default created inside the hangar of KACC Military Fuels instead of near the EasterBoard Farm
         House_AddVehicle(HouseID, ABuyableVehicles[CarModel], 0, cComponents, 697.0, 3342.0, 3.9, 0.0, -1, -1);
         // Let the player pay for buying the vehicle
         APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] - ABuyableVehicles[Price];
         // Let the player know he bought a vehicle
         format(Msg, 128, TXT_PlayerBoughtVehicle, ABuyableVehicles[CarName], ABuyableVehicles[Price]);
         SendClientMessage(playerid, 0xFFFFFFFF, Msg);
         SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerMustUseGetcarAndPark);
         // Save the player-file (and his houses)
         PlayerFile_Save(playerid);
      }
      else // The player has not enough money to buy this vehicle
          SendClientMessage(playerid, 0xFFFFFFFF, TXT_CannotAffordVehicle);
      // Stop looking for the vehicle, as it\'s found and given to the player already
      return 1;
   }
    else // The player chose another vehicle from the same class, keep looking for another one
        Counter++;
}
}
return 1;
}

 
Közben meg találtam és át is írtam a kordinátákat de ugyan oda spawnolja vissza

108
Segítségkérés / Jármû spawn kordináta át írása
« Dátum: 2012. Augusztus 02. - 10:32:35 »
Van a kamionos mód meg van adva hogy veszel egy házat és veszel bele autókat van olyan parancs hogy /park ezzel a parancsal lehet le parkirózni de van néhány ember aki ezt nem teszi meg és van olyan hogy aki nem parkolja le akkor az adott kordinátára le teszi azokat a jármûveket na én ezt akarom át írni de azt sem tudom hogy melyik PPC inc-be van benne

109
Segítségkérés / Jármû spawn kordináta át írása
« Dátum: 2012. Augusztus 01. - 21:24:02 »
Sziasztok
 
Hol lehetne át írni a nem leparkolt kocsik kordinátáját  mert nekem olyan helyen van ahol laggot okoz és oda szeretném le spawnoltatni õket ahol nem okoz laggot

110
Bemutatkozás / jozsi0502
« Dátum: 2012. Július 26. - 21:44:33 »
Idézetet írta: divkn date=1343312184\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"24994\" data-ipsquote-contentclass=\"forums_Topic
\"52354f8428.png\"
 

Hobbim:Imádok a gép elõtt ülni,buliba nem járok mert nincs kivel,és amúgy sem szeretek  balhés helyekre járni ezért nem is megyek el :P
Mintha magamat olvasnám. :D
 
[/quote]
Mert én vagyok a példa képed :) :D

111
Bemutatkozás / jozsi0502
« Dátum: 2012. Július 25. - 18:12:44 »
Kösz Srácok :)

112
Bemutatkozás / jozsi0502
« Dátum: 2012. Július 25. - 16:37:15 »
Szevasztok!
Az igazi nevem Varga József

Korom:17 éves vagyok


Itt lakom:Baranya Megye egy faluban :)


Hobbim:Imádok a gép elõtt ülni,buliba nem járok mert nincs kivel,és amúgy sem szeretek  balhés helyekre járni ezért nem is megyek el :P Szeretem a Techno,Disco,Hand\'s Up zenéket

GTA pálya futásom
3-4 hónapja kezdem el a SAMP-on játszani.Egy ideig játszottam a San Andreasal de csak annyi idõre míg ki játszottam utána nem érdekelt annyira,most meg unalom ûzés helyett próbálgatok scriptelgetni de még kezdõ vagyok szerintem jó kis móka  :)

Üdv:jozsi0502





113
Segítségkérés / sscanf hiba
« Dátum: 2012. Július 21. - 17:30:24 »
Sziasztok ezt a problémát mi okozza? Frissítettem 0.3e a sscanf-ot és ezt írja
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.
[16:44:42] sscanf error: System not initialised.

114
Segítségkérés / objectek törlése
« Dátum: 2012. Július 18. - 21:20:58 »
Köszi Szépen ment a +

115
Segítségkérés / objectek törlése
« Dátum: 2012. Július 18. - 13:08:07 »
sziasztok hogy lehet eredeti objecteket törölni a játékban pl dohetyt ki igazitani

116
Segítségkérés / Rendõr,Pizzás
« Dátum: 2012. Június 29. - 18:06:15 »
PPC_Trucking módról lenne szó azt szeretném meg tudni hogy a rendõr és a pizzás küldetéseket(munkákat hogyan lehetne beállítani hogy többet keressenek és itt vannak a kódok
Ez a pizzás
 
forward Courier_VehicleTimer(playerid);
 
// This function gets called whenever a courier player enters \"/work\"
Courier_StartJob(playerid)
{
// Setup local variables
new HouseCounter, HousesInRange[200], DialogList[200];
// First clear the house-list
for (new i; i < 11; i++)
APlayerData[playerid][CourierHouses] = 0;
// Count how many owned houses are in range of the player
for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
{
// Check if the house is owned
if (AHouseData[HouseID][Owned] == true)
{
   // Check if the house is in range of the player
   if (IsPlayerInRangeOfPoint(playerid, CourierJobRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
   {
       // Check if there aren\'t 200 in-range houses have been found yet
      if (HouseCounter < 200)
      {
         HousesInRange[HouseCounter] = HouseID; // Store the HouseID in the list of in-range houses
         HouseCounter++; // Increase the number of owned houses in range of the player (range = 1000 meters)
      }
      else
      {
         break; // Stop searching for more houses (200 is the maximum)
      }
   }
}
}
// Abort the mission if there are less than 2 houses in range and inform the player
if (HouseCounter < 2)
{
    SendClientMessage(playerid, 0xAA3333AA, \"{FF0000}Nincs elég ház megvéve.Nem tudod hova szállítani a csomagokat.\");
return 0;
}
// Try to add the 3 lines to the dialog-list
if (HouseCounter >= 2)
{
    format(DialogList, sizeof(DialogList), \" szállits 2 csomagot\\n\"); // Add the line to the dialog
APlayerData[playerid][CourierMaxStep] = 2; // Set the number of houses for the job to 2
}
if (HouseCounter >= 5)
{
    format(DialogList, sizeof(DialogList), \"%s szállits 5 csomagot\\n\", DialogList); // Add the line to the dialog
APlayerData[playerid][CourierMaxStep] = 5; // Set the number of houses for the job to 5
}
if (HouseCounter >= 10)
{
    format(DialogList, sizeof(DialogList), \"%s szállits 10 csomagot\\n\", DialogList); // Add the line to the dialog
APlayerData[playerid][CourierMaxStep] = 10; // Set the number of houses for the job to 10
}
       
// Choose a random house for the first house to visit
APlayerData[playerid][CourierHouses][1] = HousesInRange[random(HouseCounter)];
// Now choose as many houses randomly as allowed, starting from the second
for (new i = 2; i <= APlayerData[playerid][CourierMaxStep]; i++)
{
// Copy a random HouseID from the prepared list on in-range houses to the job-list
    APlayerData[playerid][CourierHouses] = HousesInRange[random(HouseCounter)];
// If the HouseID is the same as the previous HouseID (the player would visit the same house twice in a row)
while (APlayerData[playerid][CourierHouses][i - 1] == APlayerData[playerid][CourierHouses])
   APlayerData[playerid][CourierHouses] = HousesInRange[random(HouseCounter)]; // Get a new random HouseID as long as the HouseID is the same as the previous one
}
// Let the player choose how many packages he wants to deliver
ShowPlayerDialog(playerid, DialogCourierSelectQuant, DIALOG_STYLE_LIST, \"Choose how many packages you want to deliver\", DialogList, TXT_DialogButtonSelect, \"Vissza\");
return 1;
}
// This function is called when the player has chosen how many packages he wants to deliver
Courier_BeginJob(playerid)
{
// Setup local variables
new RouteText[128], Step, HouseID, Float:x, Float:y, Float:z;
// Job has started
APlayerData[playerid][JobStarted] = true;
// Store the vehicleID (required to be able to check if the player left his vehicle)
APlayerData[playerid][VehicleID] = GetPlayerVehicleID(playerid);
// Set jobstep to 1 (going to the first house)
Step = 1;
APlayerData[playerid][JobStep] = Step;
// Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
HouseID = APlayerData[playerid][CourierHouses][step];
// Set the TextDraw so the player can see it
format(RouteText, 255, \"~w~Deliver package ~b~%i/%i~w~ to: ~r~%s\", Step, APlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
// Grab the x, y, z positions for the first location
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
// Create a checkpoint where the player should deliver his package
SetPlayerCheckpoint(playerid, x, y, z, 3);
// Start a timer that ticks every second to see if the player is still inside his vehicle
APlayerData[playerid][VehicleTimerTime] = Job_TimeToFailMission;
APlayerData[playerid][VehicleTimer] = SetTimerEx(\"Courier_VehicleTimer\", 1000, true, \"d\" , playerid);
// Send the player a message to inform him that the mission has started
SendClientMessage(playerid, 0xAA3333AA, \"{00FF00}Deliver packages to player\'s houses\");
return 1;
}
 
// This function is called when a courier enters a checkpoint
Courier_OnPlayerEnterCheckpoint(playerid)
{
// Setup local variables
new RouteText[128], Step, HouseID, Float:x, Float:y, Float:z, Name[24], Msg[128], Payment;
// Check if the player is outside his vehicle while entering a checkpoint
if (GetPlayerVehicleSeat(playerid) == -1)
{
// Check if all the packages haven\'t been delivered
if (APlayerData[playerid][CourierMaxStep] != APlayerData[playerid][JobStep])
{
   // First disable the current checkpoint
   DisablePlayerCheckpoint(playerid);
   // Let the player know he delivered a package
   GameTextForPlayer(playerid, \"Leszálítottál egy csomagot\", 5000, 4);
   SendClientMessage(playerid, 0xAA3333AA, \"Leszálitottál egy csomagot\");
   // Set next JobStep (next house)
   APlayerData[playerid][JobStep]++;
   Step = APlayerData[playerid][JobStep];
   // Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
   HouseID = APlayerData[playerid][CourierHouses][step];
   // Set the TextDraw so the player can see it
   format(RouteText, 255, \"~w~Deliver package ~b~%i/%i~w~ to: ~r~%s\", Step, APlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
   TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
   // Grab the x, y, z positions for the first location
   x = AHouseData[HouseID][HouseX];
   y = AHouseData[HouseID][HouseY];
   z = AHouseData[HouseID][HouseZ];
   // Create a checkpoint where the player should deliver his package
   SetPlayerCheckpoint(playerid, x, y, z, 3);
}
else // All packages have been delivered, the player has to get paid now
{
   // Get the player name
   GetPlayerName(playerid, Name, sizeof(Name));
   // Send a message to all players to inform them that this player completed a courier-job
   format(Msg, 128, \"{FFFFFF}Pizzafutár {FF00FF}%s{FFFFFF} sikeresen leszálitott {0000FF}%i{FFFFFF} csomagot\", Name, APlayerData[playerid][CourierMaxStep]);
   SendClientMessageToAll(0xAA3333AA, Msg);
   // Set a payment based on the number of packages
   Payment = APlayerData[playerid][CourierMaxStep] * PaymentPerPackage;
   // Pay the player money and give scorepoints, both based on the number of packages delivered
   RewardPlayer(playerid, Payment, APlayerData[playerid][CourierMaxStep]);
   // Send a message to let the player know he finished his mission and got paid
   format(Msg, 128, TXT_RewardJob, Payment);
   SendClientMessage(playerid, 0xAA3333AA, Msg);
   // Increase the stats for completing a courier job
   APlayerData[playerid][statsCourierJobs]++;
   // End the current trucker job (clear mission-data)
   Courier_EndJob(playerid);
   // Also save the data (in case the server crashes, progress would be lost)
   PlayerFile_Save(playerid);
}
}
else
    SendClientMessage(playerid, 0xAA3333AA, TXT_NeedOnFootToProceed);
return 1;
}
 
// A timer that runs every second to see if the player is still inside his vehicle
public Courier_VehicleTimer(playerid)
{
new OldVehicleID = APlayerData[playerid][VehicleID];
new NewVehicleID = GetPlayerVehicleID(playerid);
if (APlayerData[playerid][VehicleTimerTime] != 0)
{
// If VehicleID and TrailerID are still the same as when the player accepted the job
if (OldVehicleID == NewVehicleID)
   APlayerData[playerid][VehicleTimerTime] = Job_TimeToFailMission; // Reset the time before the mission fails
else // Player stepped out of his vehicle
{
   new TimeLeft[5];
   // Reduce the time left by 1
   APlayerData[playerid][VehicleTimerTime] = APlayerData[playerid][VehicleTimerTime] - 1;
   // Convert the time left to a string for displaying
   valstr(TimeLeft, APlayerData[playerid][VehicleTimerTime]);
   // Display the time left
   GameTextForPlayer(playerid, TimeLeft, 1000, 4);
   // Send only one message to inform the player what he must do
   if (APlayerData[playerid][VehicleTimerTime] == (Job_TimeToFailMission - 1))
      SendClientMessage(playerid, 0xAA3333AA, \"Szálj be egy csomagkihordó jármûbe\");
}
}
else
{
    // Time left has reached 0
Courier_EndJob(playerid);
// Inform the player that he failed the mission
GameTextForPlayer(playerid, TXT_FailedMission, 5000, 4);
// Reduce the player\'s cash by 1000
RewardPlayer(playerid, -1000, 0);
}
}
 
// This function is used to stop any Courier-mission that has been started
Courier_EndJob(playerid)
{
if (APlayerData[playerid][JobStarted] == true)
{
// Clear all data about the job from the player, so he can start a new one
APlayerData[playerid][JobStarted] = false;
APlayerData[playerid][JobStep] = 0;
APlayerData[playerid][VehicleTimerTime] = 0;
APlayerData[playerid][VehicleID] = 0;
APlayerData[playerid][CourierMaxStep] = 0;
// Clear the list of houses-in-range
for (new i; i < 11; i++)
   APlayerData[playerid][CourierHouses] = 0;
// Delete the checkpoint
DisablePlayerCheckpoint(playerid);
// Reset the missiontext
TextDrawSetString(APlayerData[playerid][MissionText], \"Vállalj munkát \\\"~g~/munka~w~\\\" parancsal.\");
// Kill the VehicleTimer
KillTimer(APlayerData[playerid][VehicleTimer]);
}
return 1;
}

 
Rendõrös
 
// Forward the function to timer to check players every second to see if they\'re wanted
forward Police_CheckWantedPlayers(playerid);
forward UnjailPlayer(playerid);
 
// This timer is created every time a player changes his class to police
public Police_CheckWantedPlayers(playerid)
{
// Scan through all players
for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
{
// check if this player is connected
if (IsPlayerConnected(PlayerToCheck))
{
   //Check if that player is wanted
   if (GetPlayerWantedLevel(PlayerToCheck) > 0)
       SetPlayerMarkerForPlayer(playerid, PlayerToCheck, 0xFF0000FF); // Make that player red to the police-player
   else
   {
      // Reset the playercolor based on the player\'s class
       switch (APlayerData[PlayerToCheck][PlayerClass])
       {
           case ClassTruckDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassTruckDriver);
           case ClassBusDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassBusDriver);
           case ClassPilot: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPilot);
           case ClassPolice: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPolice);
           case ClassMafia: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassMafia);
           case ClassCourier: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassCourier);
           case ClassAssistance: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassAssistance);
           case ClassKukasDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassKukasDriver);
           case ClassDumper: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassDumper);
       }
   }
}
}
}
// This function gets called when a police player presses the SECUNDAIRY FIRE button (to warn nearby wanted players)
Police_WarnNearbyPlayers(playerid)
{
// Setup local variables
new Float:x, Float:y, Float:z, Name[24], Msg[128];
// Scan through all players
for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
{
// check if this player is connected
if (IsPlayerConnected(PlayerToCheck))
{
   // Check if the current player is wanted
   if (GetPlayerWantedLevel(PlayerToCheck) > 0)
   {
       // Get the position of this player
       GetPlayerPos(PlayerToCheck, x, y, z);
       // Check if the police-player is in range of the player
      if (IsPlayerInRangeOfPoint(playerid, 50.0, x, y, z))
      {
         GameTextForPlayer(PlayerToCheck, \"Hªz¦djon f¾lre!!! Itt a rend§rs¾g!!!\", 3000, 4); // Warn the player
         // Also start a timer which gives the player a chance to stop and get a fine
         // If he doesn\'t stop, the player will be sent to jail when he gets fined
         if (APlayerData[PlayerToCheck][PoliceWarnedMe] == false)
         {
             APlayerData[PlayerToCheck][PoliceWarnedMe] = true;
            APlayerData[PlayerToCheck][Value_PoliceCanJailMe] = 60;
            APlayerData[PlayerToCheck][Timer_PoliceCanJailMe] = SetTimerEx(\"Timer_PoliceCanJailPlayer\", 5000, true, \"i\", PlayerToCheck);
         }
         // Let the police player know that he warned the player
         GetPlayerName(PlayerToCheck, Name, sizeof(Name));
         format(Msg, 128, \"{00FF00}Felszólítottad {FFFF00}%s\", Name);
         SendClientMessage(playerid, 0xFFFFFFFF, Msg);
      }
   }
}
}
return 1;
}
// This function gets called when a police player presses the FIRE key (to fine nearby wanted players) when he\'s on foot
Police_FineNearbyPlayers(playerid)
{
// Setup local variables
new Float:x, Float:y, Float:z;
// Scan through all players
for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
{
// check if this player is connected
if (IsPlayerConnected(PlayerToCheck))
{
   // Check if the other player isn\'t the same police player
   if (PlayerToCheck != playerid)
   {
      // Check if the current player is wanted and the wanted player is driving slowly (below 30 kph)
      if ((GetPlayerWantedLevel(PlayerToCheck) > 0) && (APlayerData[PlayerToCheck][PlayerSpeed] < 30))
      {
          // Get the position of this player
          GetPlayerPos(PlayerToCheck, x, y, z);
          // Check if the police-player is in range of the player (police player and wanted player must be within 10 meters of eachother)
         if (IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
         {
             // Fine the player
            Police_PayFine(playerid, PlayerToCheck);
            // Exit the function
            return 1;
         }
         // Check if the police-player is in range of the player (he can be inside his vehicle or on foot)
         if (IsPlayerInRangeOfPoint(playerid, 50.0, x, y, z))
         {
            GameTextForPlayer(PlayerToCheck, \"Hªz¦djon f¾lre!!! Itt a rend§rs¾g!!!\", 3000, 4); // Warn the player
            // Also start a timer which gives the player a chance to stop and get a fine
            // If he doesn\'t stop, the player will be sent to jail when he gets fined
            if (APlayerData[PlayerToCheck][PoliceWarnedMe] == false)
            {
                APlayerData[PlayerToCheck][PoliceWarnedMe] = true;
               APlayerData[PlayerToCheck][Value_PoliceCanJailMe] = DefaultWarnTimeBeforeJail;
               APlayerData[PlayerToCheck][Timer_PoliceCanJailMe] = SetTimerEx(\"Timer_PoliceCanJailPlayer\", 5000, true, \"i\", PlayerToCheck);
            }
         }
      }
   }
}
}
return 1;
}
// Pay the police player and fine the player
Police_PayFine(playerid, PlayerToFine)
{
// Setup local variables
new PoliceName[24], FinedPlayerName[24], PoliceMsg[200], PlayerMsg[200], JailTime, Fine;
// Get the names of the police player and the wanted player
GetPlayerName(playerid, PoliceName, 24);
GetPlayerName(PlayerToFine, FinedPlayerName, 24);
// Check if the wanted player\'s timer hasn\'t ran out yet
if (APlayerData[PlayerToFine][PoliceCanJailMe] == false)
{
// Calculate the fine
Fine = GetPlayerWantedLevel(PlayerToFine) * DefaultFinePerStar;
// Reward the police player (give cash and points)
RewardPlayer(playerid, Fine, GetPlayerWantedLevel(PlayerToFine));
// Let the police player know that he fined the player
format(PoliceMsg, 200, \"Megbüntette: $%i\", FinedPlayerName, Fine);
SendClientMessage(playerid, 0xFF7318FF, PoliceMsg);
// Let the wanted player pay the fine
RewardPlayer(PlayerToFine, -Fine, 0);
format(PlayerMsg, 200, \"Elkapott %s és enyi birságot fizettél $%i\", PoliceName, Fine);
SendClientMessage(PlayerToFine, 0xFF7318FF, PlayerMsg);
// Let the other players know that the police player has fined the wanted player
format(PoliceMsg, 200, \"%s Megbüntette: %s\", PoliceName, FinedPlayerName);
SendClientMessageToAll(0xFF7318FF, PoliceMsg);
// Increase the stats for fining a player
APlayerData[playerid][statsPoliceFined]++;
}
else // The wanted player didn\'t pull over, now the police player has the right to send him to jail and double the fine
{
    // Set jailtime
    JailTime = DefaultJailTime;
// Calculate the fine (double the normal fine)
Fine = GetPlayerWantedLevel(PlayerToFine) * DefaultFinePerStar * 2;
// Reward the police player (give cash and points)
RewardPlayer(playerid, Fine, GetPlayerWantedLevel(PlayerToFine));
// Let the police player know that he jailed the wanted player
format(PoliceMsg, 200, \"Lecsukta és szerzett: $%i\", FinedPlayerName, Fine);
SendClientMessage(playerid, 0xFF7318FF, PoliceMsg);
// Let the wanted player pay a double fine
RewardPlayer(PlayerToFine, -Fine, 0);
// Let the player know he\'s been jailed and for how long
format(PlayerMsg, 200, \"Bezártak a börtönbe %s ennyi %i percre, PoliceName\", (JailTime / 75));
SendClientMessage(PlayerToFine, 0xFF7318FF, PlayerMsg);
// Let the other players know that the police player has jailed the wanted player
format(PoliceMsg, 200, \"Rendõr tiszt %s A börtönbe zárta %s a %i perc\", PoliceName, FinedPlayerName, (JailTime / 75));
SendClientMessageToAll(0xFF7318FF, PoliceMsg);
// Teleport the player to jail
Police_JailPlayer(PlayerToFine, JailTime);
// Increase the stats for jailing a player
APlayerData[playerid][statsPoliceJailed]++;
}
// Clear the wanted player\'s wanted status (the speedometer will automatically clear all data and kill the timer)
SetPlayerWantedLevel(PlayerToFine, 0);
// Also save the data (in case the server crashes, progress would be lost)
PlayerFile_Save(playerid);
PlayerFile_Save(PlayerToFine);
return 1;
}
// This function ports the player inside the jail and sets a timer to get him back out
Police_JailPlayer(playerid, JailTime)
{
// First remove the player from his vehicle
RemovePlayerFromVehicle(playerid);
// Set the player in the virtual world of the jail (so other players cannot see the jailed players on their radar)
SetPlayerVirtualWorld(playerid, WORLD_JAIL);
// Set player interior to the police station in San Fierro
SetPlayerInterior(playerid, 10);
// Put the player inside the jail
SetPlayerPos(playerid, 220.0, 110.0, 999.1);
// Store the jailtime for this player
APlayerData[playerid][PlayerJailed] = JailTime;
// Start the jailtimer, which checks every second if the player is allowed to get out
KillTimer(APlayerData[playerid][PlayerJailedTimer]);
APlayerData[playerid][PlayerJailedTimer] = SetTimerEx(\"UnjailPlayer\", 1000, true, \"i\", playerid);
// If the player started a job, let it fail
if (APlayerData[playerid][JobStarted] == true)
{
// Stop any job that may have started
switch (APlayerData[playerid][PlayerClass])
{
   case ClassTruckDriver: Trucker_EndJob(playerid);
   case ClassBusDriver: BusDriver_EndJob(playerid);
   case ClassPilot: Pilot_EndJob(playerid);
   case ClassPolice: Police_EndJob(playerid);
   case ClassMafia: Mafia_EndJob(playerid);
   case ClassCourier: Courier_EndJob(playerid);
   case ClassAssistance: Assistance_EndJob(playerid);
   case ClassKukasDriver: KukasDriver_EndJob(playerid);
   case ClassDumper: Dumper_EndJob(playerid);
}
// Inform the player that he failed the mission
GameTextForPlayer(playerid, \"~w~Te ~r~elrontottad~w~ a munkát.Ezért  ~y~$1000~w~ levonunk tõled.\", 5000, 4);
// Reduce the player\'s cash by 1000
RewardPlayer(playerid, -1000, 0);
}
return 1;
}
// This is the timer that runs for every player who\'s in jail
public UnjailPlayer(playerid)
{
new JailMsg[20];
// Check if the player is allowed to leave yet
if (APlayerData[playerid][PlayerJailed] == 0)
{
// Set the player in the normal world
SetPlayerVirtualWorld(playerid, 0);
// Set player interior to the outside
SetPlayerInterior(playerid, 0);
// Put the player outside the jail (he should spawn at the location where he spawned after login or after choosing a rescue-point)
SpawnPlayer(playerid);
// Also, kill the jailtimer
KillTimer(APlayerData[playerid][PlayerJailedTimer]);
}
else
{
// Show the remaining jailtime (only if the remaining time is below 60 seconds)
if (APlayerData[playerid][PlayerJailed] < 60)
{
   format(JailMsg, 20, \"~w~Szabadulsz: ~r~%i~w~ másodperc mulva.\", APlayerData[playerid][PlayerJailed]);
   GameTextForPlayer(playerid, JailMsg, 750, 4);
}
// Decrease the jailtime by 1 second
        APlayerData[playerid][PlayerJailed] = APlayerData[playerid][PlayerJailed] - 1;
}
}
// This function gets called when the police player dies (or changes class)
Police_EndJob(playerid)
{
// Kill the PlayerCheckTimer
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
// Scan through all players (to reset them to their default colors for the police-player)
for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
{
// check if this player is connected
if (IsPlayerConnected(PlayerToCheck))
{
   // Reset the playercolor based on the player\'s class
    switch (APlayerData[PlayerToCheck][PlayerClass])
    {
        case ClassTruckDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassTruckDriver);
        case ClassBusDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassBusDriver);
        case ClassPilot: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPilot);
        case ClassPolice: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassPolice);
        case ClassMafia: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassMafia);
        case ClassCourier: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassCourier);
        case ClassAssistance: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassAssistance);
        case ClassKukasDriver: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassKukasDriver);
        case ClassDumper: SetPlayerMarkerForPlayer(playerid, PlayerToCheck, ColorClassDumper);
    }
}
}
return 1;
}
// This timer is started when a wanted player was warned by a police player
forward Timer_PoliceCanJailPlayer(playerid);
public Timer_PoliceCanJailPlayer(playerid)
{
// Setup local variables
new Msg[128];
// Let the player know how much time he has left to pull over
format(Msg, 128, \"{FF0000}Álj meg %i másodperced van rá  \", APlayerData[playerid][Value_PoliceCanJailMe]);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
// Check if the timer has ran out
if (APlayerData[playerid][Value_PoliceCanJailMe] == 0)
{
    // Set a switch that indicates that this player didn\'t stop when he got the warning from the police player
    // When the police can catch him now, he\'ll be sent to jail and the fine is doubled
    APlayerData[playerid][PoliceCanJailMe] = true;
// Also kill the timer, as it\'s not needed anymore
KillTimer(APlayerData[playerid][Timer_PoliceCanJailMe]);
// Let the player know what consequences it will have by not stopping
format(Msg, 128, \"{FF0000}Ha legközelebb meg álsz börtönbe csuknak\");
SendClientMessage(playerid, 0xFF7318FF, Msg);
format(Msg, 128, \"{FF0000}Bírság duplájára növekedett\");
SendClientMessage(playerid, 0xFF7318FF, Msg);
}
// Reduce the remaining time by 5 seconds
APlayerData[playerid][Value_PoliceCanJailMe] = APlayerData[playerid][Value_PoliceCanJailMe] - 5;
return 1;
}
// This function creates a spikestrip when the player is standing
SpikeStrip_Create(playerid)
{
// Setup local variables
new StripIndex = -1, Float:x, Float:y, Float:z, Float:rot;
// Check if a spikestrip can be created
for (new i; i < MAX_SPIKESTRIPS; i++)
{
if (ASpikeStrips[spikeTime] == 0)
{
   StripIndex = i;
   break;
}
}
// Check if a free index has been found
if (StripIndex != -1)
{
// Get the position of the player
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, rot);
// Create a new spike-strip object at the location of the player and store the coordinates of the spikestrip
ASpikeStrips[stripIndex][spikeObject] = CreateObject(2892, x, y, z - 1.0, 0.0, 0.0, rot + 90.0);
ASpikeStrips[stripIndex][spikeX] = x;
ASpikeStrips[stripIndex][spikeY] = y;
ASpikeStrips[stripIndex][spikeZ] = z;
// Set the time for this timer to 1 minute
ASpikeStrips[stripIndex][spikeTime] = 600;
// Create a timer that checks all players in range to see if they run over the spikestrip
ASpikeStrips[stripIndex][spikeTimer] = SetTimerEx(\"CheckSpikeStrip\", 100, true, \"i\", StripIndex);
// Let the player know he created a spikestrip
SendClientMessage(playerid, 0xFFFFFFFF, \"{00FF00}Letetted a szögesdrótot.\");
}
else
    SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem tehetsz le több szögesdrótot.\");
}
// This timer checks the spikestrips that have been planted (they automatically disappear after one minute)
forward CheckSpikeStrip(StripIndex);
public CheckSpikeStrip(StripIndex)
{
// Setup local variables
new vid, panels, doors, lights, tires;
// Decrease the time left for the spikestrip
ASpikeStrips[stripIndex][spikeTime]--;
// Check if the spikestrip is still allowed to exist
if (ASpikeStrips[stripIndex][spikeTime] > 0)
{
// Loop through all players
for (new playerid; playerid < MAX_PLAYERS; playerid++)
{
   // Check if the player is connected
   if (APlayerData[playerid][LoggedIn] == true)
   {
      // Check if the player is the driver of a vehicle
      if (GetPlayerVehicleSeat(playerid) == 0)
      {
         // Get the vehicleid
         vid = GetPlayerVehicleID(playerid);
         // Check if the player is near the spikestrip object
         if (IsPlayerInRangeOfPoint(playerid, 7.0, ASpikeStrips[stripIndex][spikeX], ASpikeStrips[stripIndex][spikeY], ASpikeStrips[stripIndex][spikeZ]))
         {
            // Pop all the tires of the player\'s vehicle
            GetVehicleDamageStatus(vid, panels, doors, lights, tires);
            UpdateVehicleDamageStatus(vid, panels, doors, lights, 15);
         }
      }
   }
}
}
else
{
// Kill the timer and destroy the spikestrip object
DestroyObject(ASpikeStrips[stripIndex][spikeObject]);
KillTimer(ASpikeStrips[stripIndex][spikeTimer]);
}
return 1;
}
 
// This function sends the given message to all police players
Police_SendMessage(PoliceMessage[])
{
for (new PoliceID; PoliceID < MAX_PLAYERS; PoliceID++) // Loop through all players
if (APlayerData[PoliceID][LoggedIn] == true) // Check if this player has logged in
    if (APlayerData[PoliceID][PlayerClass] == ClassPolice) // Check if this player is a police player
      SendClientMessage(PoliceID, 0xFFFFFFFF, PoliceMessage); // Send the message to the police player
}

 

Dupla hozzászólás automatikusan összefûzve. ( 2012. Június 29. - 21:50:32 )

És még kellene nekem olyan sript hogy ha hirdetnek akkor ki csilagoza a számokat pl:154788 ********

117
Segítségkérés / Rendõr,Pizzás
« Dátum: 2012. Június 29. - 17:23:21 »
Sziasztok hogy lehet beálitani a rendõr munkát hogy ha elkap akkor ne csillagonként 1000$ Vonjon le hanem 10.000$ dollárt 
És a Pizzás melót is bekelene állítani de azt sem találom hogy hol lehetne ezt megtenni mert a PPC_Courier-nél nem lehet az az INC-e a pizásnak de nem lehet ott.....
Elõre is köszi a válaszokat

118
Segítségkérés / Munka bug
« Dátum: 2012. Június 28. - 12:15:05 »
:confused: Az gyönyörû

119
Segítségkérés / Munka bug
« Dátum: 2012. Június 28. - 11:55:25 »
De nem értem miért kezdet el szemétkedni különben mûködöt helyesen minden  :confused: Egyik napról a másik-ra hogy tud tönkre menni mikor nem lett hozzá nyúlva az inc-ekhez :S

120
Segítségkérés / Munka bug
« Dátum: 2012. Június 28. - 11:48:08 »
Akkor ugy van hogy a pawno mapát kell frisiteni meg inc mapát

Oldalak: 1 ... 6 7 [8] 9 10
SimplePortal 2.3.7 © 2008-2024, SimplePortal