תפריט ראשי

תוצאות 1 עד 2 מ 2
  1. #1
    הצטרף בתאריך
    17.10.2007
    עיר
    אשקלון
    הודעות
    1,456
    טוב, בפאבליק:
    [PHP]OnPlayerStateChange[/PHP]

    רשמתי את זה:
    [PHP]
    if(newstate == PLAYER_STATE_PASSENGER)
    {
    for(new m; m != MAX_VEHICLES; m++)
    {
    SetVehicleParamsForPlayer(m,playerid,0,0);//all cars unlocked
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new m; m != MAX_VEHICLES; m++)
    {
    SetVehicleParamsForPlayer(m,playerid,0,1);//all cars locked
    }
    if(IsACop(playerid))
    {
    SetVehicleParamsForPlayer(35,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(36,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(37,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(38,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(39,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(40,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(41,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(42,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(43,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(44,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(47,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(48,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(49,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(50,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(51,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(52,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(53,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(54,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(55,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(56,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(57,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(58,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(59,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(60,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(66,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(67,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(91,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(92,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(93,playerid,0,0);//unlock
    }
    if(IsAnInstructor(playerid))
    {
    SetVehicleParamsForPlayer(69,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(70,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(71,playerid,0,0);//unlock
    }
    if(IsAMedic(playerid))
    {
    SetVehicleParamsForPlayer(61,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(62,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(63,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(226,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(227,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)//NEWS
    {
    SetVehicleParamsForPlayer(96,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(97,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(98,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(179,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(180,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(181,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)//TAXI
    {
    SetVehicleParamsForPlayer(82,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(84,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(85,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(94,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(168,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(169,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(170,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(171,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(172,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(173,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pJob] == 14)
    {
    SetVehicleParamsForPlayer(64,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(65,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//ita
    {
    SetVehicleParamsForPlayer(135,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(136,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(137,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(138,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//nigg
    {
    SetVehicleParamsForPlayer(139,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(140,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(141,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(142,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)//jap
    {
    SetVehicleParamsForPlayer(159,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(160,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(161,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(162,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(163,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(182,playerid,0,0);//unlock - boat
    }
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)//rus
    {
    SetVehicleParamsForPlayer(174,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(175,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(176,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(177,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(178,playerid,0,0);//unlock
    }
    }
    [/PHP]

    עכשיו, ברגע שאני נכנס לרוב המכוניות לא נעולות, הם פתוחות, וזה יוצר מעין באגים כאלה שלפעמים אי אפשר להיכנס מאחורה וכד'.
    איך אני מסדר את זה? שנגיד שכל המכוניות סגורות ולמשל אם אתה שוטר (זה כבר מוגדר, כמו שאתם יכולים לראות..) אז זה פותח לך רק את של המשטרה, ואם אתה רוצה להיכנס ליד הנהג, אז אפשר(תמיד)...

    שוב, תודה רבה למי שעוזר.
    שתף ב-Google+

  2. #2
    הצטרף בתאריך
    17.10.2007
    עיר
    אשקלון
    הודעות
    1,456
    נכתב במקור על ידי iCoNN
    טוב, בפאבליק:
    [PHP]OnPlayerStateChange[/PHP]

    רשמתי את זה:
    [PHP]
    if(newstate == PLAYER_STATE_PASSENGER)
    {
    for(new m; m != MAX_VEHICLES; m++)
    {
    SetVehicleParamsForPlayer(m,playerid,0,0);//all cars unlocked
    }
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    for(new m; m != MAX_VEHICLES; m++)
    {
    SetVehicleParamsForPlayer(m,playerid,0,1);//all cars locked
    }
    if(IsACop(playerid))
    {
    SetVehicleParamsForPlayer(35,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(36,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(37,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(38,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(39,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(40,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(41,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(42,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(43,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(44,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(47,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(48,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(49,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(50,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(51,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(52,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(53,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(54,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(55,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(56,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(57,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(58,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(59,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(60,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(66,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(67,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(91,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(92,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(93,playerid,0,0);//unlock
    }
    if(IsAnInstructor(playerid))
    {
    SetVehicleParamsForPlayer(69,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(70,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(71,playerid,0,0);//unlock
    }
    if(IsAMedic(playerid))
    {
    SetVehicleParamsForPlayer(61,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(62,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(63,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(226,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(227,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)//NEWS
    {
    SetVehicleParamsForPlayer(96,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(97,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(98,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(179,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(180,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(181,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)//TAXI
    {
    SetVehicleParamsForPlayer(82,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(84,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(85,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(94,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(168,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(169,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(170,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(171,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(172,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(173,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pJob] == 14)
    {
    SetVehicleParamsForPlayer(64,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(65,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)//ita
    {
    SetVehicleParamsForPlayer(135,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(136,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(137,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(138,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)//nigg
    {
    SetVehicleParamsForPlayer(139,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(140,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(141,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(142,playerid,0,0);//unlock
    }
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)//jap
    {
    SetVehicleParamsForPlayer(159,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(160,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(161,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(162,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(163,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(182,playerid,0,0);//unlock - boat
    }
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)//rus
    {
    SetVehicleParamsForPlayer(174,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(175,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(176,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(177,playerid,0,0);//unlock
    SetVehicleParamsForPlayer(178,playerid,0,0);//unlock
    }
    }
    [/PHP]

    עכשיו, ברגע שאני נכנס לרוב המכוניות לא נעולות, הם פתוחות, וזה יוצר מעין באגים כאלה שלפעמים אי אפשר להיכנס מאחורה וכד'.
    איך אני מסדר את זה? שנגיד שכל המכוניות סגורות ולמשל אם אתה שוטר (זה כבר מוגדר, כמו שאתם יכולים לראות..) אז זה פותח לך רק את של המשטרה, ואם אתה רוצה להיכנס ליד הנהג, אז אפשר(תמיד)...

    שוב, תודה רבה למי שעוזר.
    הקפצה...
    עזרה בבקשה.. : )
    שתף ב-Google+

הרשמה