SA-MP Forums Archive
Don't know how to add a weapon to an expecific class - 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)
+--- Thread: Don't know how to add a weapon to an expecific class (/showthread.php?tid=358445)



Don't know how to add a weapon to an expecific class - Nunes - 10.07.2012

I'm trying to add a parachute (WeaponID 46) for Pilot Class at PPC Trucking, i used the funcion "GivePlayerWeapon(playerid, [wID] [AMMO]);" but it didn't work. I can't add it for public (non sence), i would like to know how to add a parachute when the Pilots spawn. Can anyone help me?

Thnx (:


Re: Don't know how to add a weapon to an expecific class - Vince - 10.07.2012

Use the AddPlayerClass statement if possible. If not, use SetSpawnInfo.


Re: Don't know how to add a weapon to an expecific class - Captain_Mani - 10.07.2012

Add it under OnGameModeInit in AddPlayerClass like this:
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 46, 12, 0, 0, 0, 0);
^ This is the default spawn coordinates and default skin in SAMP. 46 is the weapon ID (parachute. 12 is the amount of ammo.

+Rep me if I helped you. :P

EDIT : If you still can't understand, give me the Pilot skin AddPlayerClass statement. I will fill it and give.


Re: Don't know how to add a weapon to an expecific class - Nunes - 10.07.2012

this is the original line:

AddPlayerClass(61, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Class 10 = Pilot

it is down the function, GameModeInit_Classes i changed to:

AddPlayerClass(61, 0.0, 0.0, 0.0, 46, 12, 0, 0, 0, 0);

and didn't work, it spaws without any weapon (parachute)...

after editing i saved the file (ofc) and compilated the gamemode again, and when i saved the coords of the spawn point i got 1 warning on GM.