Problem Weapon Shop
#1

i don't know what is problem when i buy weapon nothing i don't have buyed weapon helpp fasttt
pawn Код:
#include <a_samp>
            public OnPlayerCommandText(playerid, cmdtext[])
            {
            if(!strcmp(cmdtext, "/shop"))
            {
            ShowPlayerDialog(playerid, 67, DIALOG_STYLE_LIST, "Weapon shop", "Knife - 100$\nChainsaw - 100$\nGrenade - 1500$\nMolotov Cocktail - 2000$\nDesert Eagle - 1150$\nSawnoff Shotgun - 1000$\nMicro SMG - 1000$/Uzi - 500$\nMP5 - 500$\nSniper Rifle - 1000$\nFlamethower - 2000$\nSatchel Charge - 5000$\nFire Extinguisher - 5000$\nDildo1 - 50$\nDildo2 - 200$\nParachute - 100$", "Buy", "Cancel");
            return 1;
            }
            return 0;
            }
            public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
            {
            if(dialogid == 67)
            {
            if(!response)
            return 1;
            switch(listitem)
    {
        case 0:
        {
        if(GetPlayerMoney(playerid) < 100)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -100);
        GivePlayerWeapon(playerid, 4, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 1:
        {
        if(GetPlayerMoney(playerid) < 100)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -100);
        GivePlayerWeapon(playerid, 9, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 2:
        {
        if(GetPlayerMoney(playerid) < 1500)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -1500);
        GivePlayerWeapon(playerid, 16, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 3:
        {
        if(GetPlayerMoney(playerid) < 2000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -2000);
        GivePlayerWeapon(playerid, 18, 2);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 4:
        {
        if(GetPlayerMoney(playerid) < 1150)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -1150);
        GivePlayerWeapon(playerid, 24, 100);
        SendClientMessage(playerid, 0x99FF00AA, "You have succesfully buyed your weapon.");
        }
        case 5:
        {
        if(GetPlayerMoney(playerid) < 1000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -1000);
        GivePlayerWeapon(playerid, 26, 100);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 6:
        {
        if(GetPlayerMoney(playerid) < 1000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -1000);
        GivePlayerWeapon(playerid, 28, 100);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 7:
        {
        if(GetPlayerMoney(playerid) < 500)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -500);
        GivePlayerWeapon(playerid, 29, 150);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 8:
        {
        if(GetPlayerMoney(playerid) < 1000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -1000);
        GivePlayerWeapon(playerid, 34, 10);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 9:
        {
        if(GetPlayerMoney(playerid) < 2000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -2000);
        GivePlayerWeapon(playerid, 37, 10);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 10:
        {
        if(GetPlayerMoney(playerid) < 5000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -5000);
        GivePlayerWeapon(playerid, 39, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 11:
        {
        if(GetPlayerMoney(playerid) < 5000)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -5000);
        GivePlayerWeapon(playerid, 42, 50);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 12:
        {
        if(GetPlayerMoney(playerid) < 50)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -50);
        GivePlayerWeapon(playerid, 11, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 13:
        {
        if(GetPlayerMoney(playerid) < 200)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -200);
        GivePlayerWeapon(playerid, 12, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
        }
        case 14:
        {
        if(GetPlayerMoney(playerid) < 100)
        return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
        GivePlayerMoney(playerid, -100);
        GivePlayerWeapon(playerid, 46, 1);
        SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
            }
            }
            }
            return 1;
            }
Reply
#2

Try this
PHP код:
          if(!response)
         {
        return 
1;
        }
       if(
response)
       {
            
            switch(
listitem)
           {
//////rest of your code 
Reply
#3

Quote:

.pwn(22) : warning 217: loose indentation
.pwn(149) : warning 217: loose indentation
.pwn(153) : error 030: compound statement not closed at the end of file (started at line 16)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

?? ??
Reply
#4

add under
pawn Код:
}
Reply
#5

This should work
PHP код:
            public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
            {
        if(
dialogid == 67)
        {
            if(!
response) return 1;
            if(
response)
            {
            
                switch(
listitem)
                {
                    case 
0:
                       {
                        if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid41);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
1:
                    {
                           if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid91);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                     }
                    case 
2:
                    {
                        if(
GetPlayerMoney(playerid) < 1500)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1500);
                        
GivePlayerWeapon(playerid161);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
3:
                    {
                        if(
GetPlayerMoney(playerid) < 2000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -2000);
                        
GivePlayerWeapon(playerid182);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
4:
                    {
                        if(
GetPlayerMoney(playerid) < 1150)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1150);
                        
GivePlayerWeapon(playerid24100);
                        
SendClientMessage(playerid0x99FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
5:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid26100);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
6:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid28100);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
7:
                    {
                        if(
GetPlayerMoney(playerid) < 500)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -500);
                        
GivePlayerWeapon(playerid29150);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
8:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid3410);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
9:
                    {
                        if(
GetPlayerMoney(playerid) < 2000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -2000);
                        
GivePlayerWeapon(playerid3710);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
10:
                    {
                           if(
GetPlayerMoney(playerid) < 5000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -5000);
                        
GivePlayerWeapon(playerid391);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
11:
                    {
                        if(
GetPlayerMoney(playerid) < 5000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -5000);
                        
GivePlayerWeapon(playerid4250);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
12:
                    {
                        if(
GetPlayerMoney(playerid) < 50)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -50);
                        
GivePlayerWeapon(playerid111);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
13:
                    {
                        if(
GetPlayerMoney(playerid) < 200)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -200);
                        
GivePlayerWeapon(playerid121);
                           
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
14:
                    {
                        if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid461);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                }
        }
    }
return 
1;

and for the warning just organize the script
Reply
#6

when i put this script weapon shop can't work why?

Quote:

#include <a_samp>

#define COLOR_RED 0xFF0000AA

new health;

public OnGameModeInit()
{
AddStaticVehicle(416,-166.0930,2430.7473,21.2234,323.6367,1,3); // bolnica
AddStaticVehicle(416,-158.4273,2418.4590,21.2009,328.0551,1,3); // bolnica2
health = CreatePickup(1240,1,-169.8615,2411.3901,30.9092,0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
SetPlayerMapIcon(playerid,1,-165.7226,2422.5813,23.1926,22,0,MAPICON_LOCAL);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == health)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid,COLOR_RED,"You don't have enough money to buy this!");
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-10000);
SendClientMessage(playerid,808080,"You're successfully healed for 10000$");
}
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
Reply
#7

what is problem/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)