[FilterScript] New SA:MP Weapon Models by Ericson(Must See)
#9

Quote:
Originally Posted by Cypress
Посмотреть сообщение
See the screenshot with the mp5...
lol, the mp5 is turned, but this is not the real problem:

THIS IS THE PROBLEM: When you switch weapon the old weapon stays.

I have the solution to this bug:

This is your OnDialogResponse

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == weaponmodels)
    {
        switch(listitem)
        {
            case 0:
                {
                  SetPlayerAttachedObject( playerid, 0, 2044, 6, 0.100000, 0.000000, 0.000000, 90.000000, 0.000000, 0.000000, 2.500000, 3.20000, 5.00000 ); // CJ_MP5K - Replaces MP5
                  GivePlayerWeapon(playerid, 29, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                }
            case 1:
                {
                  SetPlayerAttachedObject( playerid, 0, 2045, 6, 0.039999, 0.000000, 0.250000, 90.000000, 0.000000, 0.000000, 3.800000, 1.300000, 3.800000 ); // CJ_BBAT_NAILS - Replaces Bat
                  GivePlayerWeapon(playerid, 5, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                }
            case 2:
                {
                  SetPlayerAttachedObject( playerid, 0, 2036, 6, 0.300000, 0.0000000, 0.020000, 90.000000, 358.000000, 0.000000, 1.000000,1.90000, 3.000000 ); // CJ_psg1 - Replaces ak47
                  GivePlayerWeapon(playerid, 30, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                }
            case 3:
                {
                  SetPlayerAttachedObject( playerid, 0, 2976, 6, -0.100000, 0.000000, 0.100000, 0.000000, 80.000000, 0.000000, 1.000000, 1.000000, 1.500000 ); // green_gloop - Replaces Spas
                  GivePlayerWeapon(playerid, 27, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                }
        }
    }
    return 1;
}
Just detach the attached object before SetPlayerAttachedObject:

pawn Код:
RemovePlayerAttachedObject(playerid,0);
Working OnDialogResponse:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == weaponmodels)
    {
        switch(listitem)
        {
            case 0:
                {
                  RemovePlayerAttachedObject(playerid,0);
                  SetPlayerAttachedObject( playerid, 0, 2044, 6, 0.100000, 0.000000, 0.000000, 90.000000, 0.000000, 0.000000, 2.500000, 3.20000, 5.00000 ); // CJ_MP5K - Replaces MP5
                  GivePlayerWeapon(playerid, 29, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                  return 1;
                }
            case 1:
                {
                  RemovePlayerAttachedObject(playerid,0);
                  SetPlayerAttachedObject( playerid, 0, 2045, 6, 0.039999, 0.000000, 0.250000, 90.000000, 0.000000, 0.000000, 3.800000, 1.300000, 3.800000 ); // CJ_BBAT_NAILS - Replaces Bat
                  GivePlayerWeapon(playerid, 5, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                  return 1;
                }
            case 2:
                {
                  RemovePlayerAttachedObject(playerid,0);
                  SetPlayerAttachedObject( playerid, 0, 2036, 6, 0.300000, 0.0000000, 0.020000, 90.000000, 358.000000, 0.000000, 1.000000,1.90000, 3.000000 ); // CJ_psg1 - Replaces ak47
                  GivePlayerWeapon(playerid, 30, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                  return 1;
                }
            case 3:
                {
                  RemovePlayerAttachedObject(playerid,0);
                  SetPlayerAttachedObject( playerid, 0, 2976, 6, -0.100000, 0.000000, 0.100000, 0.000000, 80.000000, 0.000000, 1.000000, 1.000000, 1.500000 ); // green_gloop - Replaces Spas
                  GivePlayerWeapon(playerid, 27, 500000000); // you could change the amount or even remove this if it doesn't apply to you're gm
                  return 1;
                }
        }
    }
    return 0;//use return 0 on this callback
}
Reply


Messages In This Thread
New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 21.02.2011, 03:58
Re: New SA:MP Weapon Models(Must See) - by Cypress - 21.02.2011, 04:00
Re: New SA:MP Weapon Models(Must See) - by Pinehole - 21.02.2011, 05:04
Re: New SA:MP Weapon Models by Ericson(Must See) - by Ironboy - 21.02.2011, 05:06
Re : New SA:MP Weapon Models by Ericson(Must See) - by Varkoll_ - 21.02.2011, 06:41
Re: New SA:MP Weapon Models by Ericson(Must See) - by schillow - 21.02.2011, 08:33
Re: New SA:MP Weapon Models by Ericson(Must See) - by Hiddos - 21.02.2011, 08:44
Re: New SA:MP Weapon Models(Must See) - by Cypress - 21.02.2011, 11:15
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 21.02.2011, 11:53
Re: New SA:MP Weapon Models by Ericson(Must See) - by Haji - 21.02.2011, 12:02
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 21.02.2011, 12:20
Re: New SA:MP Weapon Models by Ericson(Must See) - by Zh3r0 - 21.02.2011, 12:25
Re: New SA:MP Weapon Models by Ericson(Must See) - by jameskmonger - 21.02.2011, 12:26
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 21.02.2011, 12:29
Re: New SA:MP Weapon Models by Ericson(Must See) - by jameskmonger - 21.02.2011, 12:34
Re: New SA:MP Weapon Models by Ericson(Must See) - by Zh3r0 - 21.02.2011, 12:48
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 21.02.2011, 12:53
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 21.02.2011, 14:21
Re: New SA:MP Weapon Models(Must See) - by Pinehole - 22.02.2011, 10:22
Re: New SA:MP Weapon Models by Ericson(Must See) - by Stigg - 22.02.2011, 11:01
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 22.02.2011, 11:27
Re: New SA:MP Weapon Models by Ericson(Must See) - by royal_king - 22.02.2011, 15:47
Re: New SA:MP Weapon Models by Ericson(Must See) - by LZLo - 23.02.2011, 16:29
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 28.02.2011, 15:41
Re: New SA:MP Weapon Models by Ericson(Must See) - by MrDeath537 - 28.02.2011, 16:06
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sheeba - 28.02.2011, 17:16
Re: New SA:MP Weapon Models by Ericson(Must See) - by Den_Deluxe - 28.02.2011, 17:17
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 28.02.2011, 22:08
Re: New SA:MP Weapon Models by Ericson(Must See) - by int3s0 - 01.03.2011, 01:00
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 01.03.2011, 01:08
Re: New SA:MP Weapon Models by Ericson(Must See) - by int3s0 - 01.03.2011, 01:48
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 01.03.2011, 20:14
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 02.03.2011, 14:24
Re: New SA:MP Weapon Models by Ericson(Must See) - by Sasino97 - 02.03.2011, 14:29
Re: New SA:MP Weapon Models by Ericson(Must See) - by Pinehole - 15.05.2011, 14:59

Forum Jump:


Users browsing this thread: 2 Guest(s)