Weapon adding problems (very weird)
#1

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.
Reply
#2

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

GivePlayerWeapon(playerid, weaponid, ammo);
Reply
#3

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
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)