backspace
#1

backspace to weapon shop
What is the code how to do it




PHP код:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFFFFFF
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Commands By DAVI$");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/shop"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playerid20320DIALOG_STYLE_LIST"Weapon Shop""MachineGuns\nRifles\nShotguns&Pistols""Select""Exit");
        return 
1;
    }
     if (
strcmp("/credits"cmdtexttrue10) == 0)
 {
 
SendClientMessage(playeridCOLOR_RED"1-All Copyrights related©: Davi$");
 return 
1;
}
    return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 20320 && response)
    {
        switch(
listitem)
        {
            case 
0:
            {
                
ShowPlayerDialog(playerid20321DIALOG_STYLE_LIST"Weapon Shop [MachineGuns]""Tec9 (1000$)\nMicroSMG (1500$)\nSMG (2000$) ""Buy""Cancel");
            }
            case 
1:
            {
                
ShowPlayerDialog(playerid20322DIALOG_STYLE_LIST"Weapon Shop [Rifles]""AK47 (3500$)\nM4(3500$)\nSniperRifle(4000$)\nCountryRifle(2500$)""Buy""Cancel");
            }
            case 
2:
            {
                
ShowPlayerDialog(playerid20323DIALOG_STYLE_LIST"Weapon Shop [ShotGuns&Pistols]""9mm(1000$)\nSilenced 9mm(1500$)\nDesert Eagle(2000$)\nSawnOff ShotGun(2000$)\nCombat Shotgun(2500$)\nShotGun(1500$)""Buy""Cancel");
            }
        }
    }
    if(
dialogid == 20321 && response)
    {
        switch(
listitem)
        {
            case 
0:
            {
                if(
GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -1000);
                
GivePlayerWeapon(playerid32 ,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations You have bought Tec9");
            }
            case 
1:
            {
                if(
GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -1500);
                
GivePlayerWeapon(playerid28,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations You have bought MicroSMG");
            }
            case 
2:
            {
                if(
GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -2000);
                
GivePlayerWeapon(playerid29,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations you have bought SMG");
            }
        }
    }
    if(
dialogid == 20322 && response)
    {
        switch(
listitem)
        {
            case 
0:
            {
                if(
GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -3500);
                
GivePlayerWeapon(playerid30,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations You have bought AK47");
            }
            case 
1:
            {
                if(
GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -3500);
                
GivePlayerWeapon(playerid31,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations You have bought M4");
            }
            case 
2:
            {
                if(
GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -4000);
                
GivePlayerWeapon(playerid34,500);
                
SendClientMessage(playerid,0x33AA33AA,"WeaponShop:Congratulations you have bought Sniper-Rifle");
            }
            case 
3:
            {
                if(
GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -2500);
                
GivePlayerWeapon(playerid33,500);
                
SendClientMessage(playerid,0x33AA33AA,"Weaponshop:Congratulations you have bought a Country-Rifle");
            }
        }
    }
    if(
dialogid == 20323 && response)
     {
        switch(
listitem)
        {
            case 
0:
            {
                if(
GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -1000);
                
GivePlayerWeapon(playerid22,500);
                
SendClientMessage(playerid,0x33AA33AA,"Weaponshop:Congratulations! you have bought a 9mm");
            }
            case 
1:
            {
                if(
GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -1500);
                
GivePlayerWeapon(playerid23,500);
                
SendClientMessage(playerid,0x33AA33AA"Weaponshop:Congratulations! You have bought a Silenced pistol");
            }
            case 
2:
            {
                if(
GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -4000);
                
GivePlayerWeapon(playerid24,500);
                
SendClientMessage(playerid,0x33AA33AA"Weaponshop:Congratulations! you have bought a Desert-eagle");
            }
            case 
3:
            {
                if(
GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -2000);
                
GivePlayerWeapon(playerid26,500);
                
SendClientMessage(playerid,0x33AA33AA"Weaponshop:Congratulations! you have bought a Sawn-Off Shotgun");
            }
             case 
4:
            {
                if(
GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -2500);
                
GivePlayerWeapon(playerid27,500);
                
SendClientMessage(playerid,0x33AA33AA,"Weaponshop:Congratulations! you have bough a combact-shotgun");
            }
            case 
5:
            {
                if(
GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                
GivePlayerMoney(playerid, -1500);
                
GivePlayerWeapon(playerid26,500);
                
SendClientMessage(playerid,0x33AA33AA,"Weaponshop:Congratulations! you have bought a shotgun");
            }
        }
     }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
string[64], pName[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    
format(string,sizeof string,"%s has joined the Server!",pName);
    
SendClientMessageToAll(0xFFFFFFAA,string);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
pname[MAX_PLAYER_NAME], string[39 MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnamesizeof(pname));
    switch(
reason)
    {
        case 
0format(stringsizeof(string), "%s has left the server. (Timedout)"pname);
        case 
1format(stringsizeof(string), "%s has left the server. (Leaving)"pname);
        case 
2format(stringsizeof(string), "%s has left the server. (Kicked-/-Banned)"pname);
    }
    
SendClientMessageToAll(0xAAAAAAAAstring);
    return 
1;

Reply
#2

pawn Код:
if(dialogid == 20321)
{
    if(!response) return OnPlayerCommandText(playerid, "/shop");
    your switch(listitem)
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
if(dialogid == 20321)
{
    if(!response) return OnPlayerCommandText(playerid, "/shop");
    your switch(listitem)
Where should I write this code?
Reply
#4

Here?

pawn Код:
if(dialogid == 20321 && response)
    {
        switch(listitem)
Reply
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Here?

pawn Код:
if(dialogid == 20321 && response)
    {
        switch(listitem)
Thank you so much Was
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)