Help me please. -
stundje - 19.05.2013
Hello SA-MP scripters.
I've got a problem here, I'm getting a error that states that i didnt close my FS. I'm a new scripter so i don't know what to do with this problem here:
Код:
filterscripts\weapon.pwn(80) : error 030: compound statement not closed at the end of file (started at line 41)
This is the FS.
Код:
#include <a_samp>
#include <streamer>
#include <a_zones>
#include <foreach>
#include <yom_buttons>
#include <progress>
#include <YSI\y_timers>
#include <ZCMD>
#include <sscanf2>
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define BUYWEAPONMENU 2812
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Buy Weapon System");
print("--------------------------------------\n");
return 1;
}
CMD:buyweapon(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 4.0, 314.26, -134.15, 999.60) || IsPlayerInRangeOfPoint(playerid, 6.0, 1415.727905, -1299.371093, 15.054657)) return SendClientMessage(playerid, -1, "You are not in range of the ammunation!");
ShowPlayerDialog(playerid, 2812, DIALOG_STYLE_LIST, "Buy Gun", "SDPistol-2,000$\nShotgun-5,000$\nMP5-4,000$\nDeagle-30,000$\nM4[Limited 500 bullets]-60,000$\nAK47[Limited 500 bullets]-50,000$", "Select", "Cancel");
return 1;
}
#else
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == BUYWEAPONMENU) // BUYWEAPONMENU
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 23, 99999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 25, 99999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerMoney(playerid, -4000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a MP5!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a Deagle!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a M4 - 500 Bullets!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 30, 99999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a AK/47 - 500 Bullets!");
return 1 ;
}
#endif
I really hope that someone could help me fix this problem.
Re: Help me please. -
stundje - 19.05.2013
Please help me out..
Re: Help me please. -
EmilyTexas - 19.05.2013
if(dialogid == BUYWEAPONMENU) // BUYWEAPONMENU
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 23, 99999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 25, 99999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerMoney(playerid, -4000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a MP5!");
return 1;
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a Deagle!");
return 1;
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a M4 - 500 Bullets!");
return 1;
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 30, 99999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a AK/47 - 500 Bullets!");
return 1 ;
}
}
}
}
#endif
Re: Help me please. -
Red_Dragon. - 19.05.2013
You have some missing braces. Try this
pawn Код:
#include <a_samp>
#include <streamer>
#include <a_zones>
#include <foreach>
#include <yom_buttons>
#include <progress>
#include <YSI\y_timers>
#include <ZCMD>
#include <sscanf2>
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define BUYWEAPONMENU 2812
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Buy Weapon System");
print("--------------------------------------\n");
return 1;
}
CMD:buyweapon(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 4.0, 314.26, -134.15, 999.60) || IsPlayerInRangeOfPoint(playerid, 6.0, 1415.727905, -1299.371093, 15.054657)) return SendClientMessage(playerid, -1, "You are not in range of the ammunation!");
ShowPlayerDialog(playerid, 2812, DIALOG_STYLE_LIST, "Buy Gun", "SDPistol-2,000$\nShotgun-5,000$\nMP5-4,000$\nDeagle-30,000$\nM4[Limited 500 bullets]-60,000$\nAK47[Limited 500 bullets]-50,000$", "Select", "Cancel");
return 1;
}
#else
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == BUYWEAPONMENU) // BUYWEAPONMENU
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 23, 99999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 25, 99999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerMoney(playerid, -4000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a MP5!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a Deagle!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a M4 - 500 Bullets!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 30, 99999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a AK/47 - 500 Bullets!");
return 1 ;
}
}
}
}
#endif
Re: Help me please. -
stundje - 19.05.2013
It fixed the closing problem but now i am getting this one:
Код:
C:\Users\Administrator\Desktop\FYKS-Roleplay\pawno\test.pwn(78) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Re: Help me please. -
Red_Dragon. - 19.05.2013
You must add this
Re: Help me please. -
stundje - 19.05.2013
Could you tell me where to put it exactly since i've tried alot of places and it didnt work.
Re: Help me please. -
EmilyTexas - 19.05.2013
you mean changing the return?
return 1; into return 0;
and do you have to add the return to every listitem?
Re: Help me please. -
Red_Dragon. - 19.05.2013
pawn Код:
#include <a_samp>
#include <streamer>
#include <a_zones>
#include <foreach>
#include <yom_buttons>
#include <progress>
#include <YSI\y_timers>
#include <ZCMD>
#include <sscanf2>
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define BUYWEAPONMENU 2812
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Buy Weapon System");
print("--------------------------------------\n");
return 1;
}
CMD:buyweapon(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 4.0, 314.26, -134.15, 999.60) || IsPlayerInRangeOfPoint(playerid, 6.0, 1415.727905, -1299.371093, 15.054657)) return SendClientMessage(playerid, -1, "You are not in range of the ammunation!");
ShowPlayerDialog(playerid, 2812, DIALOG_STYLE_LIST, "Buy Gun", "SDPistol-2,000$\nShotgun-5,000$\nMP5-4,000$\nDeagle-30,000$\nM4[Limited 500 bullets]-60,000$\nAK47[Limited 500 bullets]-50,000$", "Select", "Cancel");
return 1;
}
#else
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == BUYWEAPONMENU) // BUYWEAPONMENU
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 23, 99999);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 25, 99999);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerMoney(playerid, -4000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a MP5!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a Deagle!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 31, 500);
GivePlayerMoney(playerid, -60000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a M4 - 500 Bullets!");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 30, 99999);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_LIGHTBLUE," You have purchased a AK/47 - 500 Bullets!");
return 1 ;
}
}
return 0;
}
}
#endif
Re: Help me please. -
stundje - 19.05.2013
It gives the same error.