Goggles problem - 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: Goggles problem (
/showthread.php?tid=474736)
Goggles problem -
RaptorX72 - 09.11.2013
Hello
I am trying to make a pickup,what gives a Night vision goggle. The pickup is ok,but when I pick it up,it gives me nothing. (Its in a test fs)
pawn Код:
#include<a_samp>
public OnFilterScriptInit()
{
AddStaticPickup(368,2,-412.0353,2235.6851,42.4297);
return 1;
}
Re: Goggles problem -
Battlezone - 09.11.2013
Код:
new pickup_******;
public OnGameModeInit()
{
pickup_****** = CreatePickup(368,2,-412.0353,2235.6851,42.4297, -1);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup_******)
{
GivePlayerWeapon(playerid, 45, 1);
}
return 1;
}
Re: Goggles problem -
Konstantinos - 09.11.2013
The virtual world?
pawn Код:
AddStaticPickup(368,2,-412.0353,2235.6851,42.4297,-1);
If it still doesn't work, try with some other weapon and see whether that will work or not.
Re: Goggles problem -
iZN - 09.11.2013
EDIT: Try this.
pawn Код:
new NightVision;
public OnFilterScriptInit()
{
NightVision = CreatePickup(368, 2, -412.0353, 2235.6851, 42.4297, -1);
return true;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == NightVision)
{
GivePlayerWeapon(playerid, 44, 1);
}
return ture;
}
Re: Goggles problem -
RaptorX72 - 09.11.2013
Quote:
Originally Posted by iZN
Well you've forgotten something.
pawn Код:
new NightVision; public OnFilterScriptInit() { NightVision = CreatePickup(368, 2, -412.0353, 2235.6851, 42.4297, -1); return true; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == NightVision) { GivePlayerWeapon(playerid, 44, 1); } return ture; }
|
So this pickup can only be done with OnPlayerPickup?
It works fine this way,so thank you for the help everyone!
Re: Goggles problem -
Konstantinos - 09.11.2013
Quote:
Originally Posted by RaptorX72
So this pickup can only be done with OnPlayerPickup? [..]
|
No, AddStaticPickup gives automatically the weapons or health/armour.
Re: Goggles problem -
RaptorX72 - 09.11.2013
Quote:
Originally Posted by Konstantinos
No, AddStaticPickup gives automatically the weapons or health/armour.
|
Quote:
Originally Posted by Konstantinos
The virtual world?
pawn Код:
AddStaticPickup(368,2,-412.0353,2235.6851,42.4297,-1);
If it still doesn't work, try with some other weapon and see whether that will work or not.
|
Well,addstaticpickup works with other weapons,like tec9,sawnoff or with health/armour and parachute.
Only goggles dont work.