Help with /shop
#19

Bug Fixed ! thank you all for your repplys and your assistance !

i do that :
i put in my GM under public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) that :
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(response)
	    {
	    switch(dialogid)
	        {
			case 1:
	    	    {
	           	switch(listitem)
	        	{
	        	    case 0:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -3000);
	        	        GivePlayerWeapon(playerid, 31,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}M4 !");
	        	    }
	        	    case 1:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -1500);
	        	        GivePlayerWeapon(playerid, 30,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}AK47 !");
	        	    }
	        	    case 2:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -10000);
	        	        GivePlayerWeapon(playerid, 35,10);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Bazooka !");
	        	    }
	        	    case 3:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 4) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -7000);
	        	        GivePlayerWeapon(playerid, 34,50);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Sniper Rifle !");
	        	    }
	        	    case 4:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -8000);
	        	        GivePlayerWeapon(playerid, 16,10);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Grenades !");
	        	    }
	        	    case 5:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 6) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -300);
	        	        GivePlayerWeapon(playerid, 18,10);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Molotov !");
	        	    }
	        	    case 6:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 7) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -500);
	        	        GivePlayerWeapon(playerid, 22,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Colt !");
	        	    }
	        	    case 7:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 8) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -6000);
	        	        GivePlayerWeapon(playerid, 27,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Combat Shotgun !");
	        	    }
	        	    case 8:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 9) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -900);
	        	        GivePlayerWeapon(playerid, 28,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}UZI !");
	        	    }
	        	    case 9:
	        	    {
	        	        if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !");
	        	        GivePlayerMoney(playerid, -1000);
	        	        GivePlayerWeapon(playerid, 29,100);
	        	        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
	        	        SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}MP5 !");

	        	    }

	    	    }
			}
	    }
	}
	return 1;
}
and under public OnPlayerCommandText(playerid, cmdtext[])(in my GM) i put this :
Код:
if (strcmp("/shop", cmdtext, true, 10) == 0)  //i changed: COMMAND:shop(playerid, params[]) 
{
if(gTeam[playerid] == TEAM_ZOMBIE)
{
SendClientMessage(playerid, 0x9EC73DAA,"Zombies can't buy Guns !");
}
else
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose a gun to buy", "M4 \
     {F81414}$3000(100ammo) \nAK-47  {F81414}$1500(100ammo) \nBazooka  {F81414}$10000(10Ammo) \n\
    Sniper Rifle  {F81414}$7000(50ammo) \nGrenades  {F81414}$8000(10ammo) \nMolotov  {F81414}$400(10ammo)\
     \nColt  {F81414}$500(100ammo) \nCombat Shotgun  {F81414}$6000(100ammo) \nUZI  {F81414}$900(100ammo) \
     \nMP5  {F81414}$1000(100ammo) \n   ", "Buy", "Cancel"); // You can change the dialog ID to your own
}
    return 1;
}
It is Working 100% without Warnings(thanx a lot of you all for your assistances )
Reply


Messages In This Thread
Help with /shop - by ServerScripter - 21.08.2011, 14:54
Re: Help with /shop - by System64 - 21.08.2011, 14:57
Re: Help with /shop - by ServerScripter - 21.08.2011, 15:12
Re: Help with /shop - by [MWR]Blood - 21.08.2011, 15:15
Re: Help with /shop - by Improvement™ - 21.08.2011, 15:16
Re: Help with /shop - by Kush - 21.08.2011, 15:18
Re: Help with /shop - by ServerScripter - 21.08.2011, 15:28
Re: Help with /shop - by Improvement™ - 21.08.2011, 15:28
Re: Help with /shop - by Improvement™ - 21.08.2011, 15:31
Re: Help with /shop - by ServerScripter - 21.08.2011, 15:34
Re: Help with /shop - by [MWR]Blood - 21.08.2011, 15:38
Re: Help with /shop - by ServerScripter - 21.08.2011, 15:43
Re: Help with /shop - by System64 - 21.08.2011, 15:45
Re: Help with /shop - by [MWR]Blood - 21.08.2011, 15:48
Re: Help with /shop - by ServerScripter - 21.08.2011, 16:05
Re: Help with /shop - by [MWR]Blood - 21.08.2011, 16:07
Re: Help with /shop - by ServerScripter - 21.08.2011, 16:17
Re: Help with /shop - by [MWR]Blood - 21.08.2011, 16:22
Re: Help with /shop - by ServerScripter - 21.08.2011, 16:26
Re: Help with /shop - by Improvement™ - 21.08.2011, 16:29

Forum Jump:


Users browsing this thread: 2 Guest(s)