Help with Weapon buy by command
#1

English Version:
I got this script to buy weapons with the command / comprararmas [id]. When I type the command to buy the grenade, the purchase is completed successfully. But to buy other weapons, just get the grenade, even without compilation errors. How to set respectively the weapon at his command? Sorry for bad English, is that I'm Brazilian.
Brazilian Version
Eu tenho esse script para comprar armas atravйs do comando /comprararmas [id]. Quando eu digito o comando para comprar a granada, a compra й feita com sucesso. Mas para comprar outras armas, apenas recebo a granada, mesmo sem erros de compilaзгo. Como fazer para receber a arma respectivamente ao seu comando?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/armas", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid,0x00F6F6AA,"Para comprar as suas armas /comprararma [id]");
		SendClientMessage(playerid,0x00F6F6AA,"Nem todas as armas estгo listadas para ninguйm ter vantagem sobre ninguйm");
		SendClientMessage(playerid,0x00F6F6AA,"Granada---16");
		SendClientMessage(playerid,0x00F6F6AA,"Pistola 9mm---22");
		SendClientMessage(playerid,0x00F6F6AA,"Desert Eagle---24");
		SendClientMessage(playerid,0x00F6F6AA,"Sawn-off Shotgun---26");
		SendClientMessage(playerid,0x00F6F6AA,"Combat Shotgun---27");
		SendClientMessage(playerid,0x00F6F6AA,"Micro SMG---28");
		SendClientMessage(playerid,0x00F6F6AA,"AK47---29");
		SendClientMessage(playerid,0x00F6F6AA,"M4---31");
		return 1;
}
	if (strcmp("/comprararma 16", cmdtext, true, 10) == 0)
	{
	GivePlayerWeapon(playerid,16,350);
	GivePlayerMoney(playerid,-500);
	SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
	return 1;
}
	if (strcmp("/comprararma 22", cmdtext, true, 10) == 0)
	{
	GivePlayerWeapon(playerid,22, 350);
	GivePlayerMoney(playerid,-500);
	SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
	return 1;
}
  	if (strcmp("/comprararma 24", cmdtext, true, 10) == 0)
  	{
  	GivePlayerWeapon(playerid,24,350);
  	GivePlayerMoney(playerid,-500);
  	SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  	return 1;
}
  if (strcmp("/comprararma 26", cmdtext, true, 10) == 0)
  {
  GivePlayerWeapon(playerid,26,350);
  GivePlayerMoney(playerid,-500);
  SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  return 1;
}
  if (strcmp("/comprararma 27", cmdtext, true, 10) == 0)
  {
  GivePlayerWeapon(playerid,27,350);
  GivePlayerMoney(playerid,-500);
  SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  return 1;
}
  if (strcmp("/comprararma 28", cmdtext, true, 10) == 0)
  {
  GivePlayerWeapon(playerid,28,350);
  GivePlayerMoney(playerid,-500);
  SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  return 1;
}
  if (strcmp("/comprararma 29", cmdtext, true, 10) == 0)
  {
  GivePlayerWeapon(playerid,29,350);
  GivePlayerMoney(playerid,-500);
  SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  return 1;
}
  if (strcmp("/comprararma 31", cmdtext, true, 10) == 0)
  {
  GivePlayerWeapon(playerid,31,350);
  GivePlayerMoney(playerid,-500);
  SendClientMessage(playerid,COLOR_GREEN,"Arma comprada com sucesso!");
  return 1;
}
	return 0;
}
Reply


Messages In This Thread
Help with Weapon buy by command - by [BEP]AcerPilot - 05.02.2010, 00:43
Re: Help with Weapon buy by command - by mansonh - 05.02.2010, 03:41
Re: Help with Weapon buy by command - by [BEP]AcerPilot - 05.02.2010, 19:20
Re: Help with Weapon buy by command - by mansonh - 06.02.2010, 07:31

Forum Jump:


Users browsing this thread: 1 Guest(s)