SA-MP Forums Archive
Weapon adding problems (very weird) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weapon adding problems (very weird) (/showthread.php?tid=130648)



Weapon adding problems (very weird) - Andy_McKinley - 27.02.2010

I have a gamemode with 4 teams, I want different weapons on each team.

Example:
I want to give Team Army a SMG (1000 ammo), M4(1000 ammo), Desert Eagle (500 ammo) and a Knife.

But, when I script it, it only gives the first weapon (SMG for example).

pawn Код:
if(gTeam[playerid] == TEAM_TERRORISTS)
    {
      GivePlayerWeapon(playerid, 9, 30);
        SetPlayerColor(playerid,COLOR_RED); // Red
    }
ID 9 is the Chainsaw ID, ID 30 the AK-47. It only gives the team the chainsaw, nothing else.
_________________________________________________
And another bug; when I enter more than 2 weapon ID's, it gives me a warning

Код:
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(547) : warning 202: number of arguments does not match definition
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(547) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Could someone tell me how to fix the ''only the first weapon at spawn'' bug and tell me how to add more than only 2 without warnings.


Re: Weapon adding problems (very weird) - Torran - 27.02.2010

https://sampwiki.blast.hk/wiki/GivePlayerWeapon

GivePlayerWeapon(playerid, weaponid, ammo);


Re: Weapon adding problems (very weird) - Naxix - 27.02.2010

Hey there, i'm not sure about this code, but i think i might work.

Код:
if(gTeam[playerid] == TEAM_TERRORISTS)
	{
	  GivePlayerWeapon(playerid, 9, 1);
       GivePlayerWeapon(playerid, 30, 1000);
	  SetPlayerColor(playerid,COLOR_RED); // Red
	}
EDIT: Beaten with a few secs


Re: Weapon adding problems (very weird) - Andy_McKinley - 27.02.2010

Thanks a lot guys! How could I be so stupid lol?? :P Thanks for helping me.