Author Topic: How to use OnPickedUp.  (Read 4952 times)

0 Members and 1 Guest are viewing this topic.

Offline JackDawZ

  • Street Thug
  • *
  • Posts: 23
    • View Profile
How to use OnPickedUp.
« on: October 24, 2012, 12:14:41 pm »
if you want to make the pickup with many functions, read my article.

For a beginning:
Quote
#define JACK_WHITE 0xFFFFFFAA // Copypast to your pwn file

1st Step. To add pickup

Quote
public OnGameModeInit()
{
AddStaticPickup (1, 410, -442.8760, -315.8749, 11.1867); // Hidden Package
AddStaticPickup (2, 356, -703.3553, -411.1085, 10.5188); // Box

2nd Step. to make a function of the pickup

Quote
public OnPickedUp(playerid,pickupid)
{
if ( pickupid == 1) // Function of 1st pickup
{
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 5000); // +5.000$ to the cash
SendClientMessage(playerid, JACK_WHITE, "You picked up hidden package! Award: 5000$");
}
if ( pickupid == 2) // Function of 2nd pickup
{
SetPlayerWeapon(playerid, 21, 500); // Gives a stubby
SendClientMessage(playerid, JACK_WHITE, "You picked up box with a stubby shotgun!");
}
return 1;
}
« Last Edit: August 04, 2013, 04:46:26 pm by JackDawZ »
Proud member of TRC since 28th January of 2013, LGS, XE-Servers, Extreme Addicts Moderator.




Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: How to use OnPickedUp.
« Reply #1 on: October 24, 2012, 01:53:42 pm »
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};
« Last Edit: October 24, 2012, 02:09:17 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: How to use OnPickedUp.
« Reply #2 on: October 24, 2012, 02:32:45 pm »
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};

It's not pawno code, but PAWN code. ( Pawno is the editor, PAWN is the language.. )
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: How to use OnPickedUp.
« Reply #3 on: October 24, 2012, 02:40:24 pm »
It's not pawno code, but PAWN code. ( Pawno is the editor, PAWN is the language.. )

I know.

But I told Pawno Code cuse "Pawno Code" appears above code. ;)
First time I typed "Pawn Code" , but I saw that and I wanted to tell how is there.

[pawn]Pawno Code[/pawn]

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline JackDawZ

  • Street Thug
  • *
  • Posts: 23
    • View Profile
Re: How to use OnPickedUp.
« Reply #4 on: October 26, 2012, 11:38:22 am »
Good Job.

Good for begginers !  ;)

P.S.: Next time use [ code ] not [ quote ]
Exist and [ pawn ] but is a bit bugged so ... use [ code ]

CODE:
Code: [Select]
Is for code => can be used for scripts.
QUOTE:
Quote
Isn't for code / pawno code => is not for scripts.

PAWN:
[pawn]Is for Pawno Code.[/pawn]

When you copy/paste a script in [ pawn ] , is possible to show wrong some parts !

[pawn]new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};[/pawn]

Same code but I used [ code ]

Code: [Select]
new RandomPlayerJailSpawns[][playerjailspawns] = {
{387.0193,-510.2893,9.3956},
{388.4367,-511.6012,9.3956}
};

Ok thanks. I have understood.
Proud member of TRC since 28th January of 2013, LGS, XE-Servers, Extreme Addicts Moderator.