Szerző Téma: Fegyver bug  (Megtekintve 856 alkalommal)

Fegyver bug
« Dátum: 2014. április 17. - 12:45:48 »
0 Show voters
Sziasztok!
egy olyan gondom lenne, hogy rendõr szoliba állok és felveszem a fegyverzetemet.
Bele van írva hogy milyen fegyvert és ahhoz menyi lõszert adjon. Szépen meg is adja.
Azonban ha beszállok egy kocsiba és kiszállok akkor meg végtelen a töltényszám :(
Valaki tudna segíteni nekem ?
Így veszem fel a fegyvert pl deagle:
 
          if(listitem == 2) // Deagle
    {
              GivePlayerWeapon(playerid, 24, 100);
      PlayerInfo[playerid][pGun2] = 24;
              TogglePlayerControllable(playerid,1);
    }

 
A segítséget elõre is köszönöm!

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #1 Dátum: 2014. április 17. - 16:11:54 »
0 Show voters
Az általad bemásolt pár sor forráskódból nem tudtunk meg sokat, ugyanis az elmondásod szerint az OnPlayerExitVehicle/OnPlayerEnterVehicle/OnPlayerStateChange callbackek valamelyike alatt van valami hiba (habár máshol is lehet, de ez a legvalószínûbb).

Fegyver bug
« Válasz #2 Dátum: 2014. április 17. - 17:19:57 »
0 Show voters
OnPlayerExitVehicle:
 
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerSeatbelt[playerid] == 1)
{
        new string[128];
       new sendername[24];
   PlayerSeatbelt[playerid] = 0;
   GetPlayerName(playerid, sendername, sizeof(sendername));
             format(string, sizeof(string), \" %s kicsatolta az övét és kinyitotta az ajtót\", sendername);
       ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
    if(vehicleid >= Pizza[0] && vehicleid <= Pizza[4])
    {
if(PlayerInfo[playerid][pPRoute] == 1)
{
    SendClientMessage(playerid, COLOR_WHITE,\"PizzaFutár mondja : Jött egy újabb megrendelés vidd a pizzát a házhoz! Megjelöltük a helyet a GPS-en!\");
          SetPlayerAttachedObject( playerid, 0, 1582, 1, -0.064613, 0.520760, 0.000000, 0.000000, 84.217391, 0.000000, 1.000000, 1.000000, 1.000000 );
       ApplyAnimation(playerid,\"CARRY\",\"crry_prtial\",4.1,1,0,0,1,1);
    }
 }
 StopAudioStreamForPlayer(playerid);
 return 1;
}

 
OnPlayerEnterVehicle:
 
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(vehicleid >= vipCars[0] && vehicleid <= vipCars[42])
{
    if(PlayerInfo[playerid][pDonateRank] < 1)
    {
       SendClientMessage(playerid, -1,\"Nem vagy VIP tag!\");
       ClearAnimations(playerid);
}
}
if(vehicleid >= rlounge[0] && vehicleid <= rlounge[3])
{
    if(PlayerInfo[playerid][pDonateRank] < 1)
    {
    SendClientMessage(playerid, -1,\" Nem vagy VIP tag!\");
    ClearAnimations(playerid);
    }
}
if(vehicleid >= Kukas[0] && vehicleid <= Kukas[2])
{
    if(PlayerInfo[playerid][pJob] != 11)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy kukás!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Sofor[0] && vehicleid <= Sofor[12])
{
    if(PlayerInfo[playerid][pJob] != 24)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy a Fuvarozók ZRT munkatársa!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Utnyalo[0] && vehicleid <= Utnyalo[8])
{
    if(PlayerInfo[playerid][pJob] != 23)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Úttisztító!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Pizza[0] && vehicleid <= Pizza[5])
{
    if(PlayerInfo[playerid][pJob] != 22)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Pizza futár!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Pizza[0] && vehicleid <= Pizza[4])
{
    if(PlayerInfo[playerid][pJob] != 20)
    {
        SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Pizza futár!\");
        ClearAnimations(playerid);
    }
}
if(vehicleid >= CopVehicle[0] && vehicleid <= CopVehicle[6])
{
if(PlayerInfo[playerid][pMember] != 1)
    {
       SendClientMessage(playerid, COLOR_WHITE,\"Nincs kulcsod ehez a jármûhöz!( Frakció kocsi!)\");
       ClearAnimations(playerid);
}
}
return 1;
}

 
OnPlayerStateChange:
 
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[128];
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
    ShowSpeed[playerid] = 1;

 
Ezekre gondoltál ? Közbe észrevettem, hogy ha kilépék és visszalépek akkor is végtelen a lõszer :(

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #3 Dátum: 2014. április 17. - 22:49:29 »
0 Show voters
Ezekben szerintem minden okés. Nem is tudom, talán egy timerben, vagy OnPlayerUpdate alatt. Vagy akkor OnPlayer(Dis)connect alatt. Én ilyen hibával sosem találkoztam, szóval csak tippelni tudom, bocsi. Esetleg keress rá a fegyver adásokra, hátha valahol ott lesz a hiba. De lehet, hogy valami egyéb bug, ami a forráskóddal összefügg, de nincs konkrétan benne. Áh, nem tudom... Azért megpróbáltam...

Fegyver bug
« Válasz #4 Dátum: 2014. április 18. - 10:02:35 »
0 Show voters
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);
new panels, tires;
if(!IsPlayerInAnyVehicle(playerid) && weaponid == 44 || weaponid == 45)
{
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(Keys & KEY_FIRE) return 0;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        for(new i = 0; i < sizeof(SpikeInfo); i++)
         {
             if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))
            {
                 if(SpikeInfo[sCreated] == 1)
                 {
                     new carid = GetPlayerVehicleID(playerid);
            GetVehicleDamageStatus(carid, panels, doors, lights, tires);
            tires = encode_tires(1, 1, 1, 1);
            UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                     return 0;
                 }
             }
         }
     }
        if(PlayerInfo[playerid][beingDraggedBy] != -1)
{
   if(IsPlayerConnected(PlayerInfo[playerid][beingDraggedBy]))
         {
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(PlayerInfo[playerid][beingDraggedBy]));
            SetPlayerInterior(playerid, GetPlayerInterior(PlayerInfo[playerid][beingDraggedBy]));
            GetPlayerPos(PlayerInfo[playerid][beingDraggedBy], PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
            SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
}
        else
        {
          PlayerInfo[playerid][beingDraggedBy] = -1;
            SendClientMessage(playerid, COLOR_GRAD1, \"The person who was dragging you has disconnected.\");
        }
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
        for(new i = 0; i < sizeof(SpikeInfo); i++)
        {
             if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))
              {
               if(SpikeInfo[sCreated] == 1)
               {
                     new carid = GetPlayerVehicleID(playerid);
            GetVehicleDamageStatus(carid, panels, doors, lights, tires);
            tires = encode_tires(1, 1, 1, 1);
            UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
         GameTextForPlayer(playerid,\"~r~Spiked\",4000,3);
           return 0;
              }
        }
        }
     }
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 597.2967,-1283.4063,862.5063))
{
           SetPlayerCheckpoint(playerid,597.2967,-1283.4063,862.5063, 3.0);
           CP[playerid] = 2330;
        }
     }
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(Keys & KEY_FIRE)
{
    if(GetPlayerWeapon(playerid) == 23 && PlayerHasTazer[playerid] == 1)
{
       for(new i; i<MAX_PLAYERS; i++)
       {
           if(IsPlayerAimingAtPlayer(playerid, i))
           {
               if(i == playerid) return 1;
              if(GetDistanceBetweenPlayers(playerid, i) < 8)
             {
              if(PlayerCuffed) return 1;
              if(IsACop(i)) return SendClientMessage(playerid, COLOR_GREY, \"   Cannot Tazer Cops / FBI / SASD !\");
              if(IsPlayerInAnyVehicle(i)) return SendClientMessage(playerid, COLOR_GREY, \"   Get the suspect out of the vehicle !\");
                     if(TazerTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, \"   Please wait while your tazer recharges!\");
            new string[128];
              TogglePlayerControllable(i, 0);
             format(string, sizeof(string), \"* You were Tazed by %s for 8 seconds.\", PlayerName(playerid));
             SendClientMessage(i, COLOR_LIGHTBLUE, string);
             if(PlayerInfo[pMask] == 1)
             {
                format(string, sizeof(string), \"* You Tazed A Stranger for 8 seconds.\");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), \"* %s shoots with his Tazer at A Stranger, and tazed him.\", PlayerName(playerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                format(string, sizeof(string), \"* You Tazed %s for 8 seconds.\",PlayerName(i));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), \"* %s shoots with his Tazer at %s, and tazed him.\", PlayerName(playerid),PlayerName(i));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            SetTimerEx(\"TazerTimer\", 8000, false, \"i\", playerid);
            TazerTime[playerid] = 1;
             GameTextForPlayer(i, \"~r~Tazed\", 2500, 3);
             PlayerCuffed = 1;
             PlayerCuffedTime = 8;
             ApplyAnimation(i, \"PED\",\"FLOOR_hit_f\", 4.0, 1, 0, 0, 0, 0);
                }
          else
          {
              SendClientMessage(playerid, COLOR_GREY, \" Túl messze van a gyanúsított!\");
              return 1;
          }
        }
    }
         }
}
return 1;
}

 
Szerintem itt lesz a baj valahol csak nem találtam meg hogy hol.

Dupla hozzászólás automatikusan összefûzve. ( 2014. április 18. - 10:19:22 )

Vagy még ez.
 
public OnPlayerDisconnect(playerid, reason)
{
    new disconnectstr[128];
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    new caller = Mobile[playerid];
    gActivePlayers[playerid]--;
    numplayers--;
    KillTimer(RelogTimer[playerid]);
    TextDrawHideForPlayer(playerid, Website);
    TextDrawHideForPlayer(playerid, Time);
TextDrawHideForPlayer(playerid, Date);
for(new i = 1; i < MAX_POINTS; i++)
{
    if(PointAttemptingToCapture[playerid] == i)
    {
   Capturing[playerid] = 0;
   PointAttemptingToCapture[playerid] = 0;
   KillTimer(pointtimer);
   format(disconnectstr, sizeof(disconnectstr), \"Játékos %s lecsatlakozott.\", PointStatistics[pointname]);
   SendFamilyMessageToAll(YELLOW, disconnectstr);
   capturegoingon = 0;
   break;
}
}
    if(GetPVarType(playerid, \"pDynamicBB\"))
{
   DestroyDynamicObject(GetPVarInt(playerid, \"pDynamicBB\"));
         DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, \"pDynamicBBLabel\"));
    if(GetPVarType(playerid, \"pDynamicBBArea\"))
    {
   format(string, sizeof(string), \"A boombox tulajdonos (%s) már kijelentkezett!\", SenderName(playerid));
            foreach(Player, i)
   {
              if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, \"pDynamicBBArea\")))
                {
                  StopAudioEx(i);
                    SendClientMessage(i, COLOR_PURPLE, string);
      }
   }
}
}
if(usingcarwash == playerid)
{
    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
    usingcarwash = -2000;
    Update3DTextLabelText(entrancetext, 0x008B00FF, \"Autómosó\\nÁra: 2000FT (/autómosó)\");
}
if(CurrentCCTV[playerid] > -1)
{
    KillTimer(KeyTimer[playerid]);
    TextDrawHideForPlayer(playerid, TD);
}
CurrentCCTV[playerid] = -1;
      if (GetPVarInt(playerid, \"Renting\") == 1)
IsRented[GetPVarInt(playerid, \"CarRentID\")] = 0,
SetVehicleToRespawn(GetPVarInt(playerid, \"CarRentID\"));
DeletePVar(playerid, \"Renting\");
DeletePVar(playerid, \"CarRentID\");
    PlayerInfo[playerid][pAdjustable] = 1;
    if(PlayerInfo[playerid][Robbing] == 1)
{
    if(RobStatus[setup] == 1 && RobStatus[beingRobbed] == 0 && RobStatus[RobberID1] == playerid)
    {
        RobStatus[setup] = 0;
        SendClientMessage(RobStatus[RobberID1], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID2], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID3], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID4], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID5], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        RobStatus[RobberID1] = 255;
        RobStatus[RobberID2] = 255;
        RobStatus[RobberID3] = 255;
        RobStatus[RobberID4] = 255;
        RobStatus[RobberID5] = 255;
    }
    if(RobStatus[RobberID1] == playerid)
{
    RobStatus[RobberID1] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_LIGHTBLUE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID2] == playerid)
{
    RobStatus[RobberID2] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
      RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID3] == playerid)
{
    RobStatus[RobberID3] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID4] == playerid)
{
    RobStatus[RobberID4] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID5] == playerid)
{
    RobStatus[RobberID5] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
format(string,sizeof(string),\"Már meghalt és nem kapja meg a %dFT-ot!\",PlayerInfo[playerid][CashLoaded]);
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerInfo[playerid][CashLoaded] = 0;
PlayerInfo[playerid][Robbing] = 0;
DisablePlayerCheckpoint(playerid);
}
    if(HasPlantWeed[playerid] != 0) DestroyDynamicObject(Weed[playerid]);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    switch(reason)
{
case 0: format(string, sizeof(string), \"* %s elhagyta a szervert. (Idõtúllépés)\", sendername);
case 1: format(string, sizeof(string), \"* %s elhagyta a szervert. (Kilépett)\", sendername);
case 2: format(string, sizeof(string), \"* %s elhagyta a szervert. (Kirúgva)\", sendername);
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
ProxDetector(30.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
}
    if(PlayerTied[playerid] > 0 || PlayerCuffed[playerid] > 0 && PlayerInfo[playerid][pJailed] == 0)
{
PlayerInfo[playerid][pJailed] = 1; PlayerInfo[playerid][pJailTime] = 800;
}
OnPlayerSave(playerid);
    new x = 0;
while(x != MAX_PLAYERS)
{
if(IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectatedID
  • == playerid)

{
    SetPlayerHealth(x, PlayerInfo
  • [pHealth]);

   SetPlayerArmour(x, PlayerInfo
  • [pArmor]);

   SetPlayerVirtualWorld(x, PlayerInfo
  • [pVirtualWorld]);

   SetPlayerInterior(x, PlayerInfo
  • [pInt]);

            SetPlayerPos(x, PlayerInfo
  • [pSPos_x], PlayerInfo
  • [pSPos_y], PlayerInfo
  • [pSPos_z]);

   SetPlayerFacingAngle(x, PlayerInfo
  • [pSPos_r]);

   SendClientMessage(x, COLOR_WHITE, \"Ön már nem nézõ!\");
            TogglePlayerSpectating(x, 0);
            SpectatedID
  • = INVALID_PLAYER_ID;

            SpectateType
  • = ADMIN_SPEC_TYPE_NONE;

            HidePM
  • = 0;

   PhoneOnline
  • = 0;

   ResetPlayerAdminWeaponsEx(x);
}
x++;
}
////foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(TaxiAccepted < 999)
        {
        if(TaxiAccepted == playerid)
        {
            TaxiAccepted = 999;
            GameTextForPlayer(i, \"~w~A taxi sofõr~n~~r~elhagyta a szervert!\", 5000, 1);
            TaxiCallTime = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        else if(BusAccepted < 999)
        {
        if(BusAccepted == playerid)
        {
            BusAccepted = 999;
            GameTextForPlayer(i, \"~w~A buszsofõr~n~~r~elhagyta a szervert!\", 5000, 1);
            BusCallTime = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        if(GoChase < 999)
        {
            if(GoChase == playerid)
            {
                SendClientMessage(i, COLOR_YELLOW, \"A célpont elhagyta a szervert.\");
                GoChase = 999;
            }
        }
    }
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
    if(IsPlayerConnected(TransportDriver[playerid]))
{
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), \"~w~A fuvarnak vége~n~~g~szerzett %dFT-ot!\",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
}
}
if(BombID[playerid] != 0)
{
        DestroyDynamicObject(BombID[playerid]);
}
if(PlayerPaintballing[playerid] != 0)
{
    PaintballPlayers --;
}
if(caller != 255)
{
    SendClientMessage(caller,  COLOR_GRAD2, \"A vonal megszakadt...\");
    CellTime[caller] = 0;
    Mobile[caller] = 255;
    SetPlayerSpecialAction(caller,SPECIAL_ACTION_STOPUSECELLPHONE);
}
if(PlayersChannel[playerid] < 999)
{
IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
}
if(PlayerBoxing[playerid] > 0)
{
    if(Boxer1 == playerid)
    {
        if(IsPlayerConnected(Boxer2))
        {
           PlayerBoxing[boxer2] = 0;
           SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
           SetPlayerInterior(Boxer2, 5);
           GameTextForPlayer(Boxer2, \"~r~A mecs megszakítva\", 5000, 1);
   }
    }
    else if(Boxer2 == playerid)
    {
        if(IsPlayerConnected(Boxer1))
        {
           PlayerBoxing[boxer1] = 0;
           SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
           SetPlayerInterior(Boxer1, 5);
           GameTextForPlayer(Boxer1, \"~r~A mecs megszakítva\", 5000, 1);
   }
    }
    InRing = 0;
        RoundStarted = 0;
Boxer1 = 255;
Boxer2 = 255;
TBoxer = 255;
}
    if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
    else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
if(ThiefText[playerid] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(ThiefText[playerid]);
if(PlayerHadDeagle[playerid] == 1) PlayerInfo[playerid][pGun2] = 24;
if(PlayerInfo[playerid][pJob] == 2)
{
    if(JobDuty[playerid] == 1) { Lawyers -= 1; }
}
if(PlayerInfo[playerid][pJob] == 11)
{
    if(JobDuty[playerid] == 1) { Medics -= 1; }
}
else if(PlayerInfo[playerid][pJob] == 7)
{
    if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
if(PlayerInfo[playerid][PlayerVehicleModel1] != 0)
{
ResetPlayerVehicle(playerid,1);
}
if(PlayerInfo[playerid][PlayerVehicleModel2] != 0)
{
ResetPlayerVehicle(playerid,2);
}
if(PlayerInfo[playerid][PlayerVehicleModel3] != 0)
{
ResetPlayerVehicle(playerid,3);
}
if(PlayerInfo[playerid][PlayerVehicleModel4] != 0)
{
ResetPlayerVehicle(playerid,4);
}
if(PlayerInfo[playerid][PlayerVehicleModel5] != 0)
{
ResetPlayerVehicle(playerid,5);
}
    printf(\"//Deleting Vehicles For ID: %d\", playerid);
return 1;
}
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
    //TUTORIAL
    if(PlayerInfo[playerid][pTut] == 0)
    {
        HideArea(playerid);
        ShowGUI(playerid);
        gOoc[playerid] = 1; gNewbie[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1; RegistrationStep[playerid] = 1; CanTalk[playerid] = 1;
   SetPlayerPos(playerid, 1305.5662841797,-1543.8950195313,122.20141601563);
   TogglePlayerControllable(playerid, 0);
   SetPlayerCameraPos(playerid, 1460.0, -1324.0, 287.2);
   SetPlayerCameraLookAt(playerid, 1374.5, -1291.1, 239.0);
   ShowPlayerDialog(playerid, SEXMENU, DIALOG_STYLE_MSGBOX, \"{00C0FF}Immigration Center - First Question\",\"{FFFFFF}- What Is your Gender ?\\n[Note : Fake Info Will get you {A80000}Perm-Banned{FFFFFF} from Immigrating to LS]\", \"Male\", \"Female\");
   return 1;
    }
    HideGUI(playerid);
    //PAINTBALL
if(PlayerPaintballing[playerid] > 0)
{
    HideArea(playerid);
    PlayerInfo[playerid][pHospital] = 0;
    ResetPlayerWeapons(playerid);
    GivePlayerAdminGun(playerid, 24);
   GivePlayerAdminGun(playerid, 29);
    new rand = random(sizeof(PaintballSpawns));
   SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
   SetPlayerToTeamColor(playerid);
   SetCameraBehindPlayer(playerid);
    return 1;
}
//JAIL
if(PlayerInfo[playerid][pJailed] == 1)
{
            HideArea(playerid);
    SetPlayerInterior(playerid, 6);
   SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
   SetCameraBehindPlayer(playerid);
   SetPlayerFacingAngle( playerid, -90);
   SetPlayerToTeamColor(playerid);
   CanTalk[playerid] = 1;
   return 1;
}
if(PlayerInfo[playerid][pJailed] == 2)
{
   HideArea(playerid);
   Pause(playerid);
   SetPlayerInterior(playerid, 0);
   SetCameraBehindPlayer(playerid);
   CanTalk[playerid] = 1;
   PlayerInfo[playerid][pSafeSpawn] = 0;
   TogglePlayerControllable(playerid, 1);
   new rand = random(sizeof(PrisonSpawns));
   PlayerCell = rand;
   SetPlayerPos(playerid, PrisonSpawns[rand][0], PrisonSpawns[rand][1], PrisonSpawns[rand][2]);
            SetPlayerFacingAngle(playerid, PrisonSpawns[rand][3]);
            StopAudioStreamForPlayer(playerid);
   return 1;

}
« Utoljára szerkesztve: 2014. április 18. - 10:19:23 írta Jim Toretto »

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #5 Dátum: 2014. április 18. - 17:05:13 »
0 Show voters
Na jó, próbálkozok tovább, ugyanis láttam egy ilyet:
 
GivePlayerAdminGun();

 
Ez nem ad véletlenül végtelen lõszert? A SetPlayerSpawn callback alatt láttam, ami custom dolog, de gondolom connectkor hívódik meg. Habár nincs köze a kocsikhoz. Hacsak nem a GivePlayerAdminGunban. Bár ki tudja...

Fegyver bug
« Válasz #6 Dátum: 2014. április 17. - 12:45:48 »
0 Show voters
Sziasztok!
egy olyan gondom lenne, hogy rendõr szoliba állok és felveszem a fegyverzetemet.
Bele van írva hogy milyen fegyvert és ahhoz menyi lõszert adjon. Szépen meg is adja.
Azonban ha beszállok egy kocsiba és kiszállok akkor meg végtelen a töltényszám :(
Valaki tudna segíteni nekem ?
Így veszem fel a fegyvert pl deagle:
 
          if(listitem == 2) // Deagle
    {
              GivePlayerWeapon(playerid, 24, 100);
      PlayerInfo[playerid][pGun2] = 24;
              TogglePlayerControllable(playerid,1);
    }

 
A segítséget elõre is köszönöm!

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #7 Dátum: 2014. április 17. - 16:11:54 »
0 Show voters
Az általad bemásolt pár sor forráskódból nem tudtunk meg sokat, ugyanis az elmondásod szerint az OnPlayerExitVehicle/OnPlayerEnterVehicle/OnPlayerStateChange callbackek valamelyike alatt van valami hiba (habár máshol is lehet, de ez a legvalószínûbb).

Fegyver bug
« Válasz #8 Dátum: 2014. április 17. - 17:19:57 »
0 Show voters
OnPlayerExitVehicle:
 
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerSeatbelt[playerid] == 1)
{
        new string[128];
       new sendername[24];
   PlayerSeatbelt[playerid] = 0;
   GetPlayerName(playerid, sendername, sizeof(sendername));
             format(string, sizeof(string), \" %s kicsatolta az övét és kinyitotta az ajtót\", sendername);
       ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
    if(vehicleid >= Pizza[0] && vehicleid <= Pizza[4])
    {
if(PlayerInfo[playerid][pPRoute] == 1)
{
    SendClientMessage(playerid, COLOR_WHITE,\"PizzaFutár mondja : Jött egy újabb megrendelés vidd a pizzát a házhoz! Megjelöltük a helyet a GPS-en!\");
          SetPlayerAttachedObject( playerid, 0, 1582, 1, -0.064613, 0.520760, 0.000000, 0.000000, 84.217391, 0.000000, 1.000000, 1.000000, 1.000000 );
       ApplyAnimation(playerid,\"CARRY\",\"crry_prtial\",4.1,1,0,0,1,1);
    }
 }
 StopAudioStreamForPlayer(playerid);
 return 1;
}

 
OnPlayerEnterVehicle:
 
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(vehicleid >= vipCars[0] && vehicleid <= vipCars[42])
{
    if(PlayerInfo[playerid][pDonateRank] < 1)
    {
       SendClientMessage(playerid, -1,\"Nem vagy VIP tag!\");
       ClearAnimations(playerid);
}
}
if(vehicleid >= rlounge[0] && vehicleid <= rlounge[3])
{
    if(PlayerInfo[playerid][pDonateRank] < 1)
    {
    SendClientMessage(playerid, -1,\" Nem vagy VIP tag!\");
    ClearAnimations(playerid);
    }
}
if(vehicleid >= Kukas[0] && vehicleid <= Kukas[2])
{
    if(PlayerInfo[playerid][pJob] != 11)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy kukás!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Sofor[0] && vehicleid <= Sofor[12])
{
    if(PlayerInfo[playerid][pJob] != 24)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy a Fuvarozók ZRT munkatársa!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Utnyalo[0] && vehicleid <= Utnyalo[8])
{
    if(PlayerInfo[playerid][pJob] != 23)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Úttisztító!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Pizza[0] && vehicleid <= Pizza[5])
{
    if(PlayerInfo[playerid][pJob] != 22)
    {
            SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Pizza futár!\");
       ClearAnimations(playerid);
    }
}
if(vehicleid >= Pizza[0] && vehicleid <= Pizza[4])
{
    if(PlayerInfo[playerid][pJob] != 20)
    {
        SendClientMessage(playerid, COLOR_GREY,\"Nem vagy Pizza futár!\");
        ClearAnimations(playerid);
    }
}
if(vehicleid >= CopVehicle[0] && vehicleid <= CopVehicle[6])
{
if(PlayerInfo[playerid][pMember] != 1)
    {
       SendClientMessage(playerid, COLOR_WHITE,\"Nincs kulcsod ehez a jármûhöz!( Frakció kocsi!)\");
       ClearAnimations(playerid);
}
}
return 1;
}

 
OnPlayerStateChange:
 
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[128];
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
    ShowSpeed[playerid] = 1;

 
Ezekre gondoltál ? Közbe észrevettem, hogy ha kilépék és visszalépek akkor is végtelen a lõszer :(

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #9 Dátum: 2014. április 17. - 22:49:29 »
0 Show voters
Ezekben szerintem minden okés. Nem is tudom, talán egy timerben, vagy OnPlayerUpdate alatt. Vagy akkor OnPlayer(Dis)connect alatt. Én ilyen hibával sosem találkoztam, szóval csak tippelni tudom, bocsi. Esetleg keress rá a fegyver adásokra, hátha valahol ott lesz a hiba. De lehet, hogy valami egyéb bug, ami a forráskóddal összefügg, de nincs konkrétan benne. Áh, nem tudom... Azért megpróbáltam...

Fegyver bug
« Válasz #10 Dátum: 2014. április 18. - 10:02:35 »
0 Show voters
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);
new panels, tires;
if(!IsPlayerInAnyVehicle(playerid) && weaponid == 44 || weaponid == 45)
{
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(Keys & KEY_FIRE) return 0;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        for(new i = 0; i < sizeof(SpikeInfo); i++)
         {
             if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))
            {
                 if(SpikeInfo[sCreated] == 1)
                 {
                     new carid = GetPlayerVehicleID(playerid);
            GetVehicleDamageStatus(carid, panels, doors, lights, tires);
            tires = encode_tires(1, 1, 1, 1);
            UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                     return 0;
                 }
             }
         }
     }
        if(PlayerInfo[playerid][beingDraggedBy] != -1)
{
   if(IsPlayerConnected(PlayerInfo[playerid][beingDraggedBy]))
         {
   SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(PlayerInfo[playerid][beingDraggedBy]));
            SetPlayerInterior(playerid, GetPlayerInterior(PlayerInfo[playerid][beingDraggedBy]));
            GetPlayerPos(PlayerInfo[playerid][beingDraggedBy], PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
            SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
}
        else
        {
          PlayerInfo[playerid][beingDraggedBy] = -1;
            SendClientMessage(playerid, COLOR_GRAD1, \"The person who was dragging you has disconnected.\");
        }
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
        for(new i = 0; i < sizeof(SpikeInfo); i++)
        {
             if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[sX], SpikeInfo[sY], SpikeInfo[sZ]))
              {
               if(SpikeInfo[sCreated] == 1)
               {
                     new carid = GetPlayerVehicleID(playerid);
            GetVehicleDamageStatus(carid, panels, doors, lights, tires);
            tires = encode_tires(1, 1, 1, 1);
            UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
         GameTextForPlayer(playerid,\"~r~Spiked\",4000,3);
           return 0;
              }
        }
        }
     }
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 597.2967,-1283.4063,862.5063))
{
           SetPlayerCheckpoint(playerid,597.2967,-1283.4063,862.5063, 3.0);
           CP[playerid] = 2330;
        }
     }
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(Keys & KEY_FIRE)
{
    if(GetPlayerWeapon(playerid) == 23 && PlayerHasTazer[playerid] == 1)
{
       for(new i; i<MAX_PLAYERS; i++)
       {
           if(IsPlayerAimingAtPlayer(playerid, i))
           {
               if(i == playerid) return 1;
              if(GetDistanceBetweenPlayers(playerid, i) < 8)
             {
              if(PlayerCuffed) return 1;
              if(IsACop(i)) return SendClientMessage(playerid, COLOR_GREY, \"   Cannot Tazer Cops / FBI / SASD !\");
              if(IsPlayerInAnyVehicle(i)) return SendClientMessage(playerid, COLOR_GREY, \"   Get the suspect out of the vehicle !\");
                     if(TazerTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, \"   Please wait while your tazer recharges!\");
            new string[128];
              TogglePlayerControllable(i, 0);
             format(string, sizeof(string), \"* You were Tazed by %s for 8 seconds.\", PlayerName(playerid));
             SendClientMessage(i, COLOR_LIGHTBLUE, string);
             if(PlayerInfo[pMask] == 1)
             {
                format(string, sizeof(string), \"* You Tazed A Stranger for 8 seconds.\");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), \"* %s shoots with his Tazer at A Stranger, and tazed him.\", PlayerName(playerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                format(string, sizeof(string), \"* You Tazed %s for 8 seconds.\",PlayerName(i));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), \"* %s shoots with his Tazer at %s, and tazed him.\", PlayerName(playerid),PlayerName(i));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            SetTimerEx(\"TazerTimer\", 8000, false, \"i\", playerid);
            TazerTime[playerid] = 1;
             GameTextForPlayer(i, \"~r~Tazed\", 2500, 3);
             PlayerCuffed = 1;
             PlayerCuffedTime = 8;
             ApplyAnimation(i, \"PED\",\"FLOOR_hit_f\", 4.0, 1, 0, 0, 0, 0);
                }
          else
          {
              SendClientMessage(playerid, COLOR_GREY, \" Túl messze van a gyanúsított!\");
              return 1;
          }
        }
    }
         }
}
return 1;
}

 
Szerintem itt lesz a baj valahol csak nem találtam meg hogy hol.

Dupla hozzászólás automatikusan összefûzve. ( 2014. április 18. - 10:19:22 )

Vagy még ez.
 
public OnPlayerDisconnect(playerid, reason)
{
    new disconnectstr[128];
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    new caller = Mobile[playerid];
    gActivePlayers[playerid]--;
    numplayers--;
    KillTimer(RelogTimer[playerid]);
    TextDrawHideForPlayer(playerid, Website);
    TextDrawHideForPlayer(playerid, Time);
TextDrawHideForPlayer(playerid, Date);
for(new i = 1; i < MAX_POINTS; i++)
{
    if(PointAttemptingToCapture[playerid] == i)
    {
   Capturing[playerid] = 0;
   PointAttemptingToCapture[playerid] = 0;
   KillTimer(pointtimer);
   format(disconnectstr, sizeof(disconnectstr), \"Játékos %s lecsatlakozott.\", PointStatistics[pointname]);
   SendFamilyMessageToAll(YELLOW, disconnectstr);
   capturegoingon = 0;
   break;
}
}
    if(GetPVarType(playerid, \"pDynamicBB\"))
{
   DestroyDynamicObject(GetPVarInt(playerid, \"pDynamicBB\"));
         DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, \"pDynamicBBLabel\"));
    if(GetPVarType(playerid, \"pDynamicBBArea\"))
    {
   format(string, sizeof(string), \"A boombox tulajdonos (%s) már kijelentkezett!\", SenderName(playerid));
            foreach(Player, i)
   {
              if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, \"pDynamicBBArea\")))
                {
                  StopAudioEx(i);
                    SendClientMessage(i, COLOR_PURPLE, string);
      }
   }
}
}
if(usingcarwash == playerid)
{
    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
    usingcarwash = -2000;
    Update3DTextLabelText(entrancetext, 0x008B00FF, \"Autómosó\\nÁra: 2000FT (/autómosó)\");
}
if(CurrentCCTV[playerid] > -1)
{
    KillTimer(KeyTimer[playerid]);
    TextDrawHideForPlayer(playerid, TD);
}
CurrentCCTV[playerid] = -1;
      if (GetPVarInt(playerid, \"Renting\") == 1)
IsRented[GetPVarInt(playerid, \"CarRentID\")] = 0,
SetVehicleToRespawn(GetPVarInt(playerid, \"CarRentID\"));
DeletePVar(playerid, \"Renting\");
DeletePVar(playerid, \"CarRentID\");
    PlayerInfo[playerid][pAdjustable] = 1;
    if(PlayerInfo[playerid][Robbing] == 1)
{
    if(RobStatus[setup] == 1 && RobStatus[beingRobbed] == 0 && RobStatus[RobberID1] == playerid)
    {
        RobStatus[setup] = 0;
        SendClientMessage(RobStatus[RobberID1], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID2], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID3], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID4], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        SendClientMessage(RobStatus[RobberID5], COLOR_YELLOW, \"A vezetõ elhagyta a szervert, a rablásnak vége!\");
        RobStatus[RobberID1] = 255;
        RobStatus[RobberID2] = 255;
        RobStatus[RobberID3] = 255;
        RobStatus[RobberID4] = 255;
        RobStatus[RobberID5] = 255;
    }
    if(RobStatus[RobberID1] == playerid)
{
    RobStatus[RobberID1] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_LIGHTBLUE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID2] == playerid)
{
    RobStatus[RobberID2] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
      RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID3] == playerid)
{
    RobStatus[RobberID3] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID4] == playerid)
{
    RobStatus[RobberID4] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
if(RobStatus[RobberID5] == playerid)
{
    RobStatus[RobberID5] = 200;
    if(RobStatus[RobberID1] > 199 && RobStatus[RobberID2] > 199 && RobStatus[RobberID3] > 199 && RobStatus[RobberID4] > 199 && RobStatus[RobberID5] > 199)
   {
       RobStatus[beingRobbed] = 0;
       RobStatus[bankReload] = 2;
       RobStatus[setup] = 0;
       SendClientMessageToAll(COLOR_ORANGE, \"A bankrablás befejezve!\");
       FinishRobbery();
   }
}
format(string,sizeof(string),\"Már meghalt és nem kapja meg a %dFT-ot!\",PlayerInfo[playerid][CashLoaded]);
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerInfo[playerid][CashLoaded] = 0;
PlayerInfo[playerid][Robbing] = 0;
DisablePlayerCheckpoint(playerid);
}
    if(HasPlantWeed[playerid] != 0) DestroyDynamicObject(Weed[playerid]);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    switch(reason)
{
case 0: format(string, sizeof(string), \"* %s elhagyta a szervert. (Idõtúllépés)\", sendername);
case 1: format(string, sizeof(string), \"* %s elhagyta a szervert. (Kilépett)\", sendername);
case 2: format(string, sizeof(string), \"* %s elhagyta a szervert. (Kirúgva)\", sendername);
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
ProxDetector(30.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
}
    if(PlayerTied[playerid] > 0 || PlayerCuffed[playerid] > 0 && PlayerInfo[playerid][pJailed] == 0)
{
PlayerInfo[playerid][pJailed] = 1; PlayerInfo[playerid][pJailTime] = 800;
}
OnPlayerSave(playerid);
    new x = 0;
while(x != MAX_PLAYERS)
{
if(IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectatedID
  • == playerid)

{
    SetPlayerHealth(x, PlayerInfo
  • [pHealth]);

   SetPlayerArmour(x, PlayerInfo
  • [pArmor]);

   SetPlayerVirtualWorld(x, PlayerInfo
  • [pVirtualWorld]);

   SetPlayerInterior(x, PlayerInfo
  • [pInt]);

            SetPlayerPos(x, PlayerInfo
  • [pSPos_x], PlayerInfo
  • [pSPos_y], PlayerInfo
  • [pSPos_z]);

   SetPlayerFacingAngle(x, PlayerInfo
  • [pSPos_r]);

   SendClientMessage(x, COLOR_WHITE, \"Ön már nem nézõ!\");
            TogglePlayerSpectating(x, 0);
            SpectatedID
  • = INVALID_PLAYER_ID;

            SpectateType
  • = ADMIN_SPEC_TYPE_NONE;

            HidePM
  • = 0;

   PhoneOnline
  • = 0;

   ResetPlayerAdminWeaponsEx(x);
}
x++;
}
////foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(TaxiAccepted < 999)
        {
        if(TaxiAccepted == playerid)
        {
            TaxiAccepted = 999;
            GameTextForPlayer(i, \"~w~A taxi sofõr~n~~r~elhagyta a szervert!\", 5000, 1);
            TaxiCallTime = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        else if(BusAccepted < 999)
        {
        if(BusAccepted == playerid)
        {
            BusAccepted = 999;
            GameTextForPlayer(i, \"~w~A buszsofõr~n~~r~elhagyta a szervert!\", 5000, 1);
            BusCallTime = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        if(GoChase < 999)
        {
            if(GoChase == playerid)
            {
                SendClientMessage(i, COLOR_YELLOW, \"A célpont elhagyta a szervert.\");
                GoChase = 999;
            }
        }
    }
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
    if(IsPlayerConnected(TransportDriver[playerid]))
{
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), \"~w~A fuvarnak vége~n~~g~szerzett %dFT-ot!\",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
}
}
if(BombID[playerid] != 0)
{
        DestroyDynamicObject(BombID[playerid]);
}
if(PlayerPaintballing[playerid] != 0)
{
    PaintballPlayers --;
}
if(caller != 255)
{
    SendClientMessage(caller,  COLOR_GRAD2, \"A vonal megszakadt...\");
    CellTime[caller] = 0;
    Mobile[caller] = 255;
    SetPlayerSpecialAction(caller,SPECIAL_ACTION_STOPUSECELLPHONE);
}
if(PlayersChannel[playerid] < 999)
{
IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
}
if(PlayerBoxing[playerid] > 0)
{
    if(Boxer1 == playerid)
    {
        if(IsPlayerConnected(Boxer2))
        {
           PlayerBoxing[boxer2] = 0;
           SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
           SetPlayerInterior(Boxer2, 5);
           GameTextForPlayer(Boxer2, \"~r~A mecs megszakítva\", 5000, 1);
   }
    }
    else if(Boxer2 == playerid)
    {
        if(IsPlayerConnected(Boxer1))
        {
           PlayerBoxing[boxer1] = 0;
           SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
           SetPlayerInterior(Boxer1, 5);
           GameTextForPlayer(Boxer1, \"~r~A mecs megszakítva\", 5000, 1);
   }
    }
    InRing = 0;
        RoundStarted = 0;
Boxer1 = 255;
Boxer2 = 255;
TBoxer = 255;
}
    if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
    else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
if(ThiefText[playerid] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(ThiefText[playerid]);
if(PlayerHadDeagle[playerid] == 1) PlayerInfo[playerid][pGun2] = 24;
if(PlayerInfo[playerid][pJob] == 2)
{
    if(JobDuty[playerid] == 1) { Lawyers -= 1; }
}
if(PlayerInfo[playerid][pJob] == 11)
{
    if(JobDuty[playerid] == 1) { Medics -= 1; }
}
else if(PlayerInfo[playerid][pJob] == 7)
{
    if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
if(PlayerInfo[playerid][PlayerVehicleModel1] != 0)
{
ResetPlayerVehicle(playerid,1);
}
if(PlayerInfo[playerid][PlayerVehicleModel2] != 0)
{
ResetPlayerVehicle(playerid,2);
}
if(PlayerInfo[playerid][PlayerVehicleModel3] != 0)
{
ResetPlayerVehicle(playerid,3);
}
if(PlayerInfo[playerid][PlayerVehicleModel4] != 0)
{
ResetPlayerVehicle(playerid,4);
}
if(PlayerInfo[playerid][PlayerVehicleModel5] != 0)
{
ResetPlayerVehicle(playerid,5);
}
    printf(\"//Deleting Vehicles For ID: %d\", playerid);
return 1;
}
public SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
    //TUTORIAL
    if(PlayerInfo[playerid][pTut] == 0)
    {
        HideArea(playerid);
        ShowGUI(playerid);
        gOoc[playerid] = 1; gNewbie[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1; RegistrationStep[playerid] = 1; CanTalk[playerid] = 1;
   SetPlayerPos(playerid, 1305.5662841797,-1543.8950195313,122.20141601563);
   TogglePlayerControllable(playerid, 0);
   SetPlayerCameraPos(playerid, 1460.0, -1324.0, 287.2);
   SetPlayerCameraLookAt(playerid, 1374.5, -1291.1, 239.0);
   ShowPlayerDialog(playerid, SEXMENU, DIALOG_STYLE_MSGBOX, \"{00C0FF}Immigration Center - First Question\",\"{FFFFFF}- What Is your Gender ?\\n[Note : Fake Info Will get you {A80000}Perm-Banned{FFFFFF} from Immigrating to LS]\", \"Male\", \"Female\");
   return 1;
    }
    HideGUI(playerid);
    //PAINTBALL
if(PlayerPaintballing[playerid] > 0)
{
    HideArea(playerid);
    PlayerInfo[playerid][pHospital] = 0;
    ResetPlayerWeapons(playerid);
    GivePlayerAdminGun(playerid, 24);
   GivePlayerAdminGun(playerid, 29);
    new rand = random(sizeof(PaintballSpawns));
   SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
   SetPlayerToTeamColor(playerid);
   SetCameraBehindPlayer(playerid);
    return 1;
}
//JAIL
if(PlayerInfo[playerid][pJailed] == 1)
{
            HideArea(playerid);
    SetPlayerInterior(playerid, 6);
   SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
   SetCameraBehindPlayer(playerid);
   SetPlayerFacingAngle( playerid, -90);
   SetPlayerToTeamColor(playerid);
   CanTalk[playerid] = 1;
   return 1;
}
if(PlayerInfo[playerid][pJailed] == 2)
{
   HideArea(playerid);
   Pause(playerid);
   SetPlayerInterior(playerid, 0);
   SetCameraBehindPlayer(playerid);
   CanTalk[playerid] = 1;
   PlayerInfo[playerid][pSafeSpawn] = 0;
   TogglePlayerControllable(playerid, 1);
   new rand = random(sizeof(PrisonSpawns));
   PlayerCell = rand;
   SetPlayerPos(playerid, PrisonSpawns[rand][0], PrisonSpawns[rand][1], PrisonSpawns[rand][2]);
            SetPlayerFacingAngle(playerid, PrisonSpawns[rand][3]);
            StopAudioStreamForPlayer(playerid);
   return 1;

}
« Utoljára szerkesztve: 2014. április 18. - 10:19:23 írta Jim Toretto »

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
Fegyver bug
« Válasz #11 Dátum: 2014. április 18. - 17:05:13 »
0 Show voters
Na jó, próbálkozok tovább, ugyanis láttam egy ilyet:
 
GivePlayerAdminGun();

 
Ez nem ad véletlenül végtelen lõszert? A SetPlayerSpawn callback alatt láttam, ami custom dolog, de gondolom connectkor hívódik meg. Habár nincs köze a kocsikhoz. Hacsak nem a GivePlayerAdminGunban. Bár ki tudja...

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal