SA-MP Forums Archive
Help please - 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: Help please (/showthread.php?tid=94895)



Help please - [XST]O_x - 01.09.2009

hey
i want to know how to add pickups,
i already read the topic in sa-mp wiki,about how to use pickups,but i didnt understand it really
may someone give me a ready script of a pickup? i need it really

Thanks in advance


Re: Help please - LuxurioN™ - 01.09.2009

In top of your script:
pawn Код:
new TestPickUp;
In OnGameModeInit or OnFilterScriptInit:
pawn Код:
TestPickUp = CreatePickup(Model, Type, Float:X,Float:Y,Float:Z);
//Example: TestPickUp = CreatePickup(1276, 3, 541.9261,1557.4919,1.0000);
In any part of your script:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == TestPickUp)
  {
  GameTextForPlayer(playerid,"~g~You enter in test PickUp",5000,3);
  SendClientMessage(playerid,COLOR_RED,"Test PickUp");
  //Here your function (Example: GivePlayerMoney, SetPlayerPos,...)
    }
  return 1;
  }



Re: Help please - brett7 - 01.09.2009

top of script
new infopickup;


public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == infopickup)
{
SendClientMessage(playerid, 0xFFFF00AA, "yay brett7!");
}

return 1;
}

onplayer spawn

addstaitcpickup(id, x, y ,z, etc)

lux got there first but its the main idea


Re: Help please - [XST]O_x - 01.09.2009

Ty so so much


Re: Help please - [XST]O_x - 01.09.2009

Quote:
Originally Posted by ► © The LuxurioN™
In top of your script:
pawn Код:
new TestPickUp;
In OnGameModeInit or OnFilterScriptInit:
pawn Код:
TestPickUp = CreatePickup(Model, Type, Float:X,Float:Y,Float:Z);
//Example: TestPickUp = CreatePickup(1276, 3, 541.9261,1557.4919,1.0000);
In any part of your script:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == TestPickUp)
  {
  GameTextForPlayer(playerid,"~g~You enter in test PickUp",5000,3);
  SendClientMessage(playerid,COLOR_RED,"Test PickUp");
  //Here your function (Example: GivePlayerMoney, SetPlayerPos,...)
    }
  return 1;
  }

it did no errors on pawno,but my server crashed after i select class,i tried to restart,why? i put it on my fs


Re: Help please - brett7 - 01.09.2009

put it on your gamemode


Re: Help please - Imran.Abbas - 01.09.2009

Maybe of Pickup id is Worng (not Sure) Put this and TRy
Код:
//Example: TestPickUp = CreatePickup(1239, 3, 541.9261,1557.4919,1.0000);



Re: Help please - [XST]O_x - 03.09.2009

Quote:
Originally Posted by Imran.Abbas
Maybe of Pickup id is Worng (not Sure) Put this and TRy
Код:
//Example: TestPickUp = CreatePickup(1239, 3, 541.9261,1557.4919,1.0000);
thx
but i know why,i putted pickup id of a weapon,i wanted minigun so i did it with the minigun's pickup id,thats why it crashed


Re: Help please - Imran.Abbas - 03.09.2009

Quote:
Originally Posted by [KMA
America ]
Quote:
Originally Posted by Imran.Abbas
Maybe of Pickup id is Worng (not Sure) Put this and TRy
Код:
//Example: TestPickUp = CreatePickup(1239, 3, 541.9261,1557.4919,1.0000);
thx
but i know why,i putted pickup id of a weapon,i wanted minigun so i did it with the minigun's pickup id,thats why it crashed
362 - Minigun , Check on https://sampwiki.blast.hk/wiki/Model_ID


Re: Help please - [XST]O_x - 03.09.2009

Quote:
Originally Posted by Imran.Abbas
Quote:
Originally Posted by [KMA
America ]
Quote:
Originally Posted by Imran.Abbas
Maybe of Pickup id is Worng (not Sure) Put this and TRy
Код:
//Example: TestPickUp = CreatePickup(1239, 3, 541.9261,1557.4919,1.0000);
thx
but i know why,i putted pickup id of a weapon,i wanted minigun so i did it with the minigun's pickup id,thats why it crashed
362 - Minigun , Check on https://sampwiki.blast.hk/wiki/Model_ID
i know bro,i just said,that when i put the minigun pickup,my server crashes right after i select skin