Help please
#1

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

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;
  }
Reply
#3

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

Ty so so much
Reply
#5

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

put it on your gamemode
Reply
#7

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)