SA-MP Forums Archive
Creating a weapon pickup? - 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: Creating a weapon pickup? (/showthread.php?tid=107139)



Creating a weapon pickup? - Angelo94 - 08.11.2009

I can't do it, i tried but i can't find helping informations!


Re: Creating a weapon pickup? - Infamous - 08.11.2009

Have a good read here:

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


Re: Creating a weapon pickup? - Angelo94 - 08.11.2009

I tried everything but i still get errors and warnings!


Re: Creating a weapon pickup? - Infamous - 08.11.2009

Post your errors and relevant code here, if you would like further help.


Re: Creating a weapon pickup? - Angelo94 - 08.11.2009

public OnGameModeInit()
{
new pickup;
pickup = CreatePickup(359,2,19955.5645,-1615.6426,33.4479,-1);
return 1;
}



public OnPlayerPickUpPickup(playerid, pickupid)
{
if(359 == (pickup)) GivePlayerWeapon(35,10);
}




and then it goes


C:\Users\Angelo\Desktop\Grand Theft Auto -San Andreas\gamemodes\CountryStuff.pwn(383) : warning 204: symbol is assigned a value that is never used: "pickup"
C:\Users\Angelo\Desktop\Grand Theft Auto -San Andreas\gamemodes\CountryStuff.pwn(521) : error 017: undefined symbol "pickup"
C:\Users\Angelo\Desktop\Grand Theft Auto -San Andreas\gamemodes\CountryStuff.pwn(521) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Creating a weapon pickup? - member - 08.11.2009

pawn Code:
public OnGameModeInit()
{
    new mypickup;
    mypickup = CreatePickup(359,2,19955.5645,-1615.6426,33.4479,-1);
    return 1;
}
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == mypickup) GivePlayerMoney(playerid,10000);
}



Re: Creating a weapon pickup? - niCe - 12.11.2009

This is wrong. Variable "mypickup" should be defined outside OnGameModeInit, so you are able to use it in OnPlayerPickUpPickup as well.


Re: Creating a weapon pickup? - Peter_Corneile - 12.11.2009

pawn Code:
new pickup;

public OnGameModeInit()
{
   
    pickup = CreatePickup(359,2,19955.5645,-1615.6426,33.4479,-1);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == pickup)
  {
  GivePlayerWeapon(35,10);
  }
}



Re: Creating a weapon pickup? - Aerotactics - 26.06.2013

Quote:
Originally Posted by Infamous
View Post
This is what I was looking for, thanks.


Re: Creating a weapon pickup? - Aerotactics - 26.06.2013

Quote:
Originally Posted by member
View Post
pawn Code:
public OnGameModeInit()
{
    new mypickup;
    mypickup = CreatePickup(359,2,19955.5645,-1615.6426,33.4479,-1);
    return 1;
}
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == mypickup) GivePlayerMoney(playerid,10000);
}
Thanks for the script advice