mSelection problem
#1

I use this , If you entered the CheckPoint it make what in the code

PHP код:
if(getCheckpointType(playerid) == CP_WEAPS)
    {
        
ShowModelSelectionMenu(playeridgunlist2"Select Gun");
        return 
1;
    } 
PHP код:
public OnPlayerModelSelection(playeridresponselistidmodelid)
{    
         if(
listid == gunlist2)
    {
        if(
response)
        {
            switch(
modelid)
            {
                case 
331:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid1100); // Brass Knuckles //////////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
333:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid2100); // Golf Club ///////////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
335:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid4100); // Knife ///////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
336:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid5100); // Baseball Bat /////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
337:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid6100); // Shovel ////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
338:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid7100); // Pool Cue//////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
339:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid8100); // Katana ///////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
341:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid9100); // Chainsaw /////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
321:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid10100); // Double-ended Dildo //////////////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
325:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid14100); // Flowers //////////////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
326:
                if(
GetPlayerMoney(playerid) < 500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 500)
                {
                    
GivePlayerWeapon(playerid15100); // Cane ////////////////
                    
GivePlayerMoney(playerid,-500);
                    return 
1;
                }
                case 
346:
                if(
GetPlayerMoney(playerid) < 1000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 1000)
                {
                    
GivePlayerWeapon(playerid22100); // 9mm ////////////
                    
GivePlayerMoney(playerid,-1000);
                    return 
1;
                }
                case 
347:
                if(
GetPlayerMoney(playerid) < 1500)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 1500$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 1500)
                {
                    
GivePlayerWeapon(playerid23100); // Silenced 9mm /////////
                    
GivePlayerMoney(playerid,-1500);
                    return 
1;
                }
                case 
348:
                if(
GetPlayerMoney(playerid) < 4000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 4000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 4000)
                {
                    
GivePlayerWeapon(playerid24100); // Desert Eagle///////
                    
GivePlayerMoney(playerid,-4000);
                    return 
1;
                }
                case 
349:
                if(
GetPlayerMoney(playerid) < 2000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 2000)
                {
                    
GivePlayerWeapon(playerid25100); // Shotgun/////////
                    
GivePlayerMoney(playerid,-2000);
                    return 
1;
                }
                case 
350:
                if(
GetPlayerMoney(playerid) < 3000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 3000)
                {
                    
GivePlayerWeapon(playerid26100); // Sawnoff///////////
                    
GivePlayerMoney(playerid,-3000);
                    return 
1;
                }
                case 
351:
                if(
GetPlayerMoney(playerid) < 2000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 2000)
                {
                    
GivePlayerWeapon(playerid27100); // Combat Shotgun///////////
                    
GivePlayerMoney(playerid,-2000);
                    return 
1;
                }
                case 
352:
                if(
GetPlayerMoney(playerid) < 1000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 1000)
                {
                    
GivePlayerWeapon(playerid28100); // Micro SMG/Uzi//////////
                    
GivePlayerMoney(playerid,-1000);
                    return 
1;
                }
                case 
353:
                if(
GetPlayerMoney(playerid) < 3000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 3000)
                {
                    
GivePlayerWeapon(playerid29100); // MP5////////////
                    
GivePlayerMoney(playerid,-3000);
                    return 
1;
                }
                case 
355:
                if(
GetPlayerMoney(playerid) < 4000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 4000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 4000)
                {
                    
GivePlayerWeapon(playerid30100); // AK-47////////////
                    
GivePlayerMoney(playerid,-4000);
                    return 
1;
                }
                case 
356:
                if(
GetPlayerMoney(playerid) < 5000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 5000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 5000)
                {
                    
GivePlayerWeapon(playerid31100); // M4////////////
                    
GivePlayerMoney(playerid,-5000);
                    return 
1;
                }
                case 
372:
                if(
GetPlayerMoney(playerid) < 1000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 1000)
                {
                    
GivePlayerWeapon(playerid32100); // Tec-9/////////
                    
GivePlayerMoney(playerid,-1000);
                    return 
1;
                }
                case 
357:
                if(
GetPlayerMoney(playerid) < 2000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 2000)
                {
                    
GivePlayerWeapon(playerid33100); // Country Rifle////////////
                    
GivePlayerMoney(playerid,-2000);
                    return 
1;
                }
                case 
358:
                if(
GetPlayerMoney(playerid) < 3000)
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
                    return 
1;
                }
                else if(
GetPlayerMoney(playerid) >= 3000)
                {
                    
GivePlayerWeapon(playerid34100); // Sniper Rifle///////////
                    
GivePlayerMoney(playerid,-3000);
                    return 
1;
                }
            }
            
SendClientMessage(playeridCOLOR_DODGERBLUE"The weapon is selected!");
        }
        else 
SendClientMessage(playeridCOLOR_DODGERBLUE"You cancelled a weapon choice!");
        return 
1;
    }
    return 
1;

the Problem that it appear many selections and it bug everything , and i can't choose any weapon
Reply
#2

anyone ?!
Reply
#3

Why are you using 'case 33...' and not case 1?
Reply
#4

coz it's the object ID , that in the gunlist.txt
Reply
#5

Use Dialogs, I had that issue too, its the filterscript i think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)