i have a problem
#1

Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>

#define COLOR_YELLOW 0xFFFF00
#define COLOR_GRAY 0x585858

CMD:buy(playerid, params[])
{
  SendClientMessage(playerid, COLOR_YELLOW, "buy 1 M4 7000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 2 sawnoff  12000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 3 deagle  6000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 4 sniper  20000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 5 armor  1000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 6 pistol  5000$");
  SendClientMessage(playerid, COLOR_YELLOW, "buy 7 tec9  16000$");
  return 1;
}

CMD:buy1(playerid, params[])
{
   GivePlayerMoney(playerid, -7000);
   GivePlayerWeapon(playerid, 31, 500);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи M4 за 7000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
   return 1;
}

CMD:buy2(playerid, params[])
{
   GivePlayerMoney(playerid, -7000);
   GivePlayerWeapon(playerid, 26, 100);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Sawnoff за 12000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 12000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
   return 1;
}

CMD:buy3(playerid, params[])
{
   GivePlayerMoney(playerid, -6000);
   GivePlayerWeapon(playerid, 24, 900);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Deagle за 6000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
   return 1;
}

CMD:buy4(playerid, params[])
{
   GivePlayerMoney(playerid, -20000);
   GivePlayerWeapon(playerid, 34, 50);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Sniper за 20000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
   return 1;
}

CMD:buy5(playerid, params[])
{
   GivePlayerMoney(playerid, -1000);
   SetPlayerArmour(playerid, 100);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Armour за 1000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш Армор");
   return 1;
}
   return 1;
}

CMD:buy6(playerid, params[])
{
   GivePlayerMoney(playerid, -5000);
   GivePlayerWeapon(playerid, 22, 1200);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Pistol за 5000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
   return 1;
}

CMD:buy7(playerid, params[])
{
   GivePlayerMoney(playerid, -16000);
   GivePlayerWeapon(playerid, 32, 1000);
   SendClientMessage(playerid, COLOR_GRAY, "Ти си купи Tec9 за 16000$");
   }
   else
   {
   if(GetPlayerMoney(playerid) < 16000) return SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие");
   return 1;
}
ERRORS:

Код:
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(26) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(28) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(29) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(31) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(40) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(42) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(43) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(45) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(54) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(56) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(57) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(59) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(68) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(70) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(71) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(73) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(82) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(84) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(85) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(87) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(96) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(98) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(99) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(101) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(110) : error 010: invalid function or declaration
D:\igri\GTA-SanAndreas\pawno\gaga.pwn(112) : error 010: invalid function or declaration

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


26 Errors.
Reply
#2

The amount of brackets is incorrect in command buy1 to buy7.
Reply
#3

can you tell me how to do it because i script like from 3 days
Reply
#4

All the brackets are incorrectly placed, just look that the {;} are matching properly
Just use this one and make the others like this aswell
Код:
CMD:buy6(playerid, params[])
{
	new money;
	money = GetPlayerMoney(playerid);
	if(money >= 5000)
	{
		SendClientMessage(playerid, COLOR_GREY, "Ти си купи Pistol за 5000$");
		GivePlayerWeapon(playerid, 22, 1200);
		GivePlayerMoney(playerid, -5000);
	}
	if(money < 5000)
	{
		SendClientMessage(playerid, COLOR_YELLOW, "Нямаш достатъчно пари за да си купиш това оражие!");
	}
	return true;
}
And yes, i suggest people use return false and true instead of 0 and 1 since its less confusing for new scripters, especially if you have scripted many hours in a row, and are tired, since your brain is working on max level, some slips may drop in.
Reply
#5

thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)