Need some help.
#1

Aight.

Im trying to create a /holster and /unholster command. Iґve got this code:

Код:
	if(strcmp(cmd, "/holster", true) == 0)
	{
  new wid;
  new wammo;
  wid = GetPlayerWeapon(playerid);
  wammo = GetPlayerAmmo(playerid);
  if((wid >= 1 ) && (wid <= 38))
    {
		SetHolderWeapon(playerid,wid);
		RemovePlayerWeapon(playerid,wid);
		SendClientMessage(playerid,GREEN,"You holstered your weapon. To unholster it, use /unholster.");
		HolsterUsed[playerid] = 1;
		HolsterWeapon[playerid] = wid;
		HolsterAmmo[playerid] = wammo;
		return 1;
    }
	else
 	{
 	SendClientMessage(playerid,RED,"You are not holding any weapon to holster.");
	}
  }

	if(strcmp(cmd, "/unholster", true) == 0)
	{
  if(HolsterUsed[playerid] > 0)
    {
    RemoveHolderWeapon(playerid);
		GivePlayerWeapon(playerid,wid,wammo);
		SendClientMessage(playerid,GREEN,"You unholstered your gun.");
		HolsterUsed[playerid] = 0;
		HolsterWeapon[playerid] = 0;
		HolsterAmmo[playerid] = 0;
		return 1;
    }
	else
 	{
 	SendClientMessage(playerid,RED,"You havent got any weapon holstered.");
	}
  }
While on top

Код:
new HolsterUsed[MAX_PLAYERS];
new HolsterWeapon[MAX_PLAYERS];
new HolsterAmmo[MAX_PLAYERS];
But I get some cool error..

error 017: undefined symbol "wid"

Why?
Reply
#2

http://forum.sa-mp.com/index.php?topic=128891.0

whyd u create another topic?
Reply
#3

First of all, please line out your script
at { you have to ad a Tab
Reply
#4

On which line is the error
Reply
#5

Instead of GivePlayerWeapon(playerid,wid,wammo); I think it should be GivePlayerWeapon(playerid, HolsterWeapon[playerid], HolsterAmmo[playerid]);
Reply
#6

The indication just got messed up because of the forum system - in Pawno it looks fine.

Thanks - gonna try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)