Help with /shop
#1

hi , as you know, the zombies can not buy Weapons, so , i decided to put a code can do it , this is the code:
Code:
COMMAND:shop(playerid, params[])
{


	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 possible to check if the player is in some Team ? Ex please work with this example):

if(gTeam[killerid] == TEAM_ZOMBIE) (Note: i have not defined yet gTeam and MaxPlayer in GunShop FS)

where i put it?
Reply
#2

i dont understand you but try
pawn Code:
COMMAND:shop(playerid, params[])
{
if(!gTeam[killerid] == TEAM_ZOMBIE)
{
    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;
}
Reply
#3

hi, the problem is i have defined TEAM_ZOMBIE 2 in my GM

But i want to define this TEAM in GunSHop FilerScript(because i don't want zombies use command /shop)
Reply
#4

pawn Code:
COMMAND:shop(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_ZOMBIE)
{
    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
}
else return SendClientMessage(playerid,red,"* You can't use this command!");
    return 1;
}
Reply
#5

Quote:
Originally Posted by ServerScripter
View Post
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE)
killerid must be changed into playerid, because it is the playerid that is executing the command. And not the killerid.
killerid is only to be used under OnPlayerDeath & Custom Callbacks. Not under OnPlayerCommandText.

So use:
pawn Code:
if(gTeam[playerid] == TEAM_ZOMBIE)
I hope this helps you.

Kind Regards,
Improvement™
Reply
#6

Quote:
Originally Posted by Improvement™
View Post
killerid must be changed into playerid, because it is the playerid that is executing the command. And not the killerid.
killerid is only to be used under OnPlayerDeath & Custom Callbacks. Not under OnPlayerCommandText.

So use:
pawn Code:
if(gTeam[playerid] == TEAM_ZOMBIE)
I hope this helps you.

Kind Regards,
Improvement™
Well explained, good definition. Nice job.
Reply
#7

thank you all , i changed the Killerid to playerid
Code:
COMMAND:shop(playerid, params[])
{
if(!gTeam[playerid] == TEAM_ZOMBIE)
{
    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;
}
but i have 4 errors:
Code:
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(158) : error 017: undefined symbol "gTeam"
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(158) : warning 215: expression has no effect
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(158) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(158) : error 029: invalid expression, assumed zero
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(158) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Note : i have not defined TEAM_ZOMBIE and gteam ...
Reply
#8

Quote:
Originally Posted by Kush
View Post
Well explained, good definition. Nice job.
Well, Thank you .
I give examples such as these so the "Unexperienced Scripters" (Am not attempting to offence anyone), understand what they are doing wrong. And take time to explain as good as possible, unlike the most forum posters that just want to increase ther post count by just correcting the mistakes and that's all. And gain the posts count just to look "cool", or whatever the reason is behind it.
Reply
#9

Quote:
Originally Posted by ServerScripter
View Post
Note : i have not defined TEAM_ZOMBIE and gteam ...
Note for yourself:
If you look close at all 4 of those errors, you'll will see that all of those errors are showing one line: 158.
So why don't you just define the gTeam Teams?

Here's an example:
pawn Code:
//Somewhere on top of your script
#define TEAM_ZOMBIE 1
#define TEAM2 2
#define TEAM3 3

static gTeam[MAX_PLAYERS];


//Under OnPlayerRequestClass
SetPlayerClass(playerid, classid);


//This is a custom callback, put it somewhere in the middle of the script
SetPlayerClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2)
    {
        gTeam[playerid] = TEAM_ZOMBIE;
    }
    else if(classid == 3 || classid == 4 || classid == 5)
    {
        gTeam[playerid] = TEAM2;
    }
    else if(classid == 6 || classid == 7 || classid == 8)
    {
        gTeam[playerid] = TEAM3;
    }
}
EDIT: Sorry for double post, I forgot that I posted earlier on this topic..
Reply
#10

ok but i defined the Teams in my GM it is only GunShop FS (i redefined it in the TOP of the Fs..... not Working 4 errors)
Reply
#11

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
ok but i defined the Teams in my GM it is only GunShop FS (i redefined it in the TOP of the Fs..... not Working 4 errors)
Paste the errors, and the code aswell.
Reply
#12

this is the Full GunShop FS:
Код:
/*                                         ((a Simple GunShop System))
*/

// === DEFINES === //
#include <a_samp>
#include <zcmd>

#define TEAM_ZOMBIE 2  /// i Maded it 2 because i have in my GM TEAM_ZOMBIE 2////


#define FILTERSCRIPT
#define COL_RED            "{F81414}"
#define COL_WHITE          "{FFFFFF}"
#define COL_GREEN          "{6EF83C}"
#define COLOR_GREEN 0x9EC73DAA


#include <a_samp>
#include <zcmd>



#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" GunShop system with dialogs and colors loaded !");
	print("--------------------------------------\n");
	return 1;
}

#else // I din't knew how to remove this, so sorry :)

main()
{
 print("\n----------------------------------");
 print(" Blank Gamemode by your name here");
 print("----------------------------------\n");
}

#endif

public OnPlayerConnect(playerid)
{
	SendClientMessage(playerid, 0x9EC73DAA, "This server is using {F81414} GunShop with dialogs, made by The Team ,use {FFFFFF}((/shop))");
	return 1;
}

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;
}

// ============================= ZCMD COMMAND ================================//
COMMAND:shop(playerid, params[])
{
if(!gTeam[playerid] == TEAM_ZOMBIE)
{
    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;
}
The Errors:
Код:
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(152) : error 017: undefined symbol "gTeam"
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(152) : warning 215: expression has no effect
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(152) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(152) : error 029: invalid expression, assumed zero
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(152) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#13

put fs in gm
Reply
#14

I didn't mean you to paste the whole code, but whatever.
I didn't see the new gTeam[MAX_PLAYERS] at the top of your gamemode...
That's the reason for those errors to show up.
Add it, and everything should work!

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 5 seconds.

Reply
#15

this is the code now :
Код:
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;
}
whene i go IG , Zombies can use /shop ....but i want theme don't using it ...(now there are 2 warnings in the code):
Код:
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(151) : warning 213: tag mismatch
C:\DOCUME~1\mrich\Bureau\ANEPAS~1\LOGINA~1\FILTER~1\GunShop.pwn(163) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#16

pawn Код:
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;
}
The ! means 'No' in pawn.
So your code was just like:
if the player is not zombie, then send him a message the he can't buy guns...
So try the code I gave you, it should work.
Reply
#17

don't working, i think the FS don't know what is TEAM_ZOMBIE (because i have it in my GM)
so the question is how to put the FS to my GM
tell me for each command whene i put it ...(it is the preoblem i think)
Reply
#18

Just copy every function to your gamemode in the same order as is it in the filterscript.
Reply
#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
#20

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
ok but i defined the Teams in my GM it is only GunShop FS (i redefined it in the TOP of the Fs..... not Working 4 errors)
Why don't you just attempt to put the GunShop FilterScript into your GameMode? Because having a FilterScript for just a GunShop is rediculious if you ask me..
Anyways its up to you. (If you would follow this idea, make sure you have a backup .pwn of your GameMode.)

Sorry for my very late reply, I was very busy with my new server.

FIRST EDIT: This post can be deleted, since of late reply (forgot to press Submit Post in the first place..)
Also Delux, well done!

Kind Regards,
Improvement™
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)